diff --git a/src/plugins/axivion/CMakeLists.txt b/src/plugins/axivion/CMakeLists.txt index b346cc276dc..e855e419f07 100644 --- a/src/plugins/axivion/CMakeLists.txt +++ b/src/plugins/axivion/CMakeLists.txt @@ -12,4 +12,6 @@ add_qtc_plugin(Axivion axivionsettings.cpp axivionsettings.h axivionsettingspage.cpp axivionsettingspage.h axiviontr.h + dashboard/dto.cpp dashboard/dto.h + dashboard/concat.cpp dashboard/concat.h ) diff --git a/src/plugins/axivion/dashboard/concat.cpp b/src/plugins/axivion/dashboard/concat.cpp new file mode 100644 index 00000000000..837cf4a311a --- /dev/null +++ b/src/plugins/axivion/dashboard/concat.cpp @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022-current by Axivion GmbH + * https://www.axivion.com/ + * + * SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + * + * Purpose: Helper functions to concatenate strings/bytes + * + * !!!!!! GENERATED, DO NOT EDIT !!!!!! + * + * This file was generated with the script at + * /projects/libs/dashboard_cpp_api/generator/generate_dashboard_cpp_api.py + */ + +#include "dashboard/concat.h" + +#include + +template +static Output concat(const std::initializer_list &args) { + size_t size = 0; + for (const Input &arg : args) + size += arg.size(); + Output output; + output.reserve(size); + for (const Input &arg : args) + output += arg; + return output; +} + +std::string concat(const std::initializer_list &args) { + return concat(args); +} + +QString concat(const std::initializer_list &args) { + return concat(args); +} + +QByteArray concat_bytes(const std::initializer_list &args) { + return concat(args); +} diff --git a/src/plugins/axivion/dashboard/concat.h b/src/plugins/axivion/dashboard/concat.h new file mode 100644 index 00000000000..591b4ffeca3 --- /dev/null +++ b/src/plugins/axivion/dashboard/concat.h @@ -0,0 +1,30 @@ +#pragma once + +/* + * Copyright (C) 2022-current by Axivion GmbH + * https://www.axivion.com/ + * + * SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + * + * Purpose: Helper functions to concatenate strings/bytes + * + * !!!!!! GENERATED, DO NOT EDIT !!!!!! + * + * This file was generated with the script at + * /projects/libs/dashboard_cpp_api/generator/generate_dashboard_cpp_api.py + */ + +#include +#include +#include +#include + +#include +#include + +std::string concat(const std::initializer_list &args); + +QString concat(const std::initializer_list &args); + +QByteArray concat_bytes(const std::initializer_list &args); + diff --git a/src/plugins/axivion/dashboard/dto.cpp b/src/plugins/axivion/dashboard/dto.cpp new file mode 100644 index 00000000000..5c0747ea9e5 --- /dev/null +++ b/src/plugins/axivion/dashboard/dto.cpp @@ -0,0 +1,4228 @@ +/* + * Copyright (C) 2022-current by Axivion GmbH + * https://www.axivion.com/ + * + * SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + * + * Purpose: Dashboard C++ API Implementation + * + * !!!!!! GENERATED, DO NOT EDIT !!!!!! + * + * This file was generated with the script at + * /projects/libs/dashboard_cpp_api/generator/generate_dashboard_cpp_api.py + */ + +#undef QT_RESTRICTED_CAST_FROM_ASCII +#define QT_NO_CAST_FROM_ASCII 1 +#define QT_NO_CAST_TO_ASCII 1 +#define QT_NO_CAST_FROM_BYTEARRAY 1 + +#include "dashboard/dto.h" + +#include "dashboard/concat.h" + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +namespace Axivion::Internal::Dto { + + template + static std::string to_std_string(const T &e) + { + return std::to_string(e); + } + + template<> + std::string to_std_string(const QString &qstr) + { + return qstr.toStdString(); + } + + template<> + std::string to_std_string(const QAnyStringView &qasv) + { + return to_std_string(qasv.toString()); + } + + // exceptions + + invalid_dto_exception::invalid_dto_exception(const std::string_view type_name, const std::exception &ex) : + std::runtime_error(concat({ type_name, u8": ", ex.what() })) + {} + + invalid_dto_exception::invalid_dto_exception(const std::string_view type_name, const std::string_view message) : + std::runtime_error(concat({ type_name, u8": ", message })) + {} + + // throws Axivion::Internal::Dto::invalid_dto_exception + template + [[noreturn]] static void throw_invalid_dto_exception(const std::exception &ex) + { + throw invalid_dto_exception(typeid(T).name(), ex); + } + + // throws Axivion::Internal::Dto::invalid_dto_exception + template + [[noreturn]] static void throw_invalid_dto_exception(std::string_view message) + { + throw invalid_dto_exception(typeid(T).name(), message); + } + + // throws Axivion::Internal::Dto::invalid_dto_exception + template + [[noreturn]] static void throw_json_type_conversion(QJsonValue::Type type) { + throw_invalid_dto_exception(concat({ + u8"Error parsing JSON: Cannot convert type ", + to_std_string(type) + })); + } + + // throws Axivion::Internal::Dto::invalid_dto_exception + template + [[noreturn]] static void throw_json_value_conversion(const V &raw_value) { + throw_invalid_dto_exception(concat({ + u8"Error parsing JSON: Cannot convert raw value ", + to_std_string(raw_value) + })); + } + + // basic json (de)serialization + + // throws Axivion::Internal::Dto::invalid_dto_exception + template + static QJsonObject toJsonObject(const QJsonValue &json) + { + if (json.isObject()) + { + return json.toObject(); + } + throw_json_type_conversion>(json.type()); + } + + template + class de_serializer final + { + public: + // Require usage of template specializations. + // This static members have to be implemented: + // + // // throws Axivion::Internal::Dto::invalid_dto_exception + // static T deserialize(const QJsonValue &json); + // + // static QJsonValue serialize(const T &value); + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + template + static T deserialize_json(const QJsonValue &json) + { + return de_serializer::deserialize(json); + } + + // throws Axivion::Internal::Dto::invalid_dto_exception + template + static T deserialize_bytes(const QByteArray &json) + { + QJsonValue qjv; + { + QJsonParseError error; + const QJsonDocument qjd = QJsonDocument::fromJson(json, &error); + if (error.error != QJsonParseError::ParseError::NoError) + { + throw_invalid_dto_exception(concat({ + u8"Error parsing JSON - ", + to_std_string(error.error), + u8" at ", + to_std_string(error.offset), + u8": ", + to_std_string(error.errorString()) + })); + } + if (!qjd.isObject()) + { + throw_invalid_dto_exception(u8"Error parsing JSON: parsed data is no JSON object"); + } + qjv = QJsonValue(qjd.object()); + } + return deserialize_json(qjv); + } + + template + static QJsonValue serialize_json(const T &value) + { + return de_serializer::serialize(value); + } + + template + static QByteArray serialize_bytes(const T &value) + { + QJsonDocument qjd; + { + QJsonValue qjv = serialize_json(value); + if (qjv.isObject()) + { + qjd = QJsonDocument(qjv.toObject()); + } + else if (qjv.isArray()) + { + qjd = QJsonDocument(qjv.toArray()); + } + else + { + throw std::domain_error(concat({ + u8"Error serializing JSON - value is not an object or array:", + to_std_string(qjv.type()) + })); + } + } + return qjd.toJson(QJsonDocument::JsonFormat::Indented); + } + + template<> + class de_serializer final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static std::nullptr_t deserialize(const QJsonValue &json) + { + if (json.isNull()) + { + return nullptr; + } + throw_json_type_conversion(json.type()); + } + + static QJsonValue serialize(const std::nullptr_t&) + { + return {}; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + template<> + class de_serializer final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static QString deserialize(const QJsonValue &json) + { + if (json.isString()) + { + return json.toString(); + } + throw_json_type_conversion(json.type()); + } + + static QJsonValue serialize(const QString &value) + { + return { value }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + template<> + class de_serializer final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static bool deserialize(const QJsonValue &json) + { + if (json.isBool()) + { + return json.toBool(); + } + throw_json_type_conversion(json.type()); + } + + static QJsonValue serialize(const bool &value) + { + return { value }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + template<> + class de_serializer final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static qint32 deserialize(const QJsonValue &json) + { + if (!json.isDouble()) + { + throw_json_type_conversion(json.type()); + } + const double rawValue = json.toDouble(); + const qint32 value = static_cast(rawValue); + if (static_cast(value) != rawValue) + { + throw_json_value_conversion(rawValue); + } + return value; + } + + static QJsonValue serialize(const qint32 &value) + { + return { static_cast(value) }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + template<> + class de_serializer final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static qint64 deserialize(const QJsonValue &json) + { + if (!json.isDouble()) + { + throw_json_type_conversion(json.type()); + } + const double rawValue = json.toDouble(); + const qint64 value = static_cast(rawValue); + if (static_cast(value) != rawValue) + { + throw_json_value_conversion(rawValue); + } + return value; + } + + static QJsonValue serialize(const qint64 &value) + { + return { value }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + static const QLatin1String deSerializerDoublePositiveInfinity{"Infinity"}; + static const QLatin1String deSerializerDoubleNegativeInfinity{"-Infinity"}; + static const QLatin1String deSerializerDoubleNAN{"NaN"}; + + template<> + class de_serializer final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static double deserialize(const QJsonValue &json) + { + if (json.isDouble()) + { + return json.toDouble(); + } + if (json.isString()) + { + const QString rawValue = json.toString(); + if (rawValue == deSerializerDoublePositiveInfinity) + { + return std::numeric_limits::infinity(); + } + if (rawValue == deSerializerDoubleNegativeInfinity) + { + return -std::numeric_limits::infinity(); + } + if (rawValue == deSerializerDoubleNAN) + { + return std::numeric_limits::quiet_NaN(); + } + throw_json_value_conversion(rawValue); + } + throw_json_type_conversion(json.type()); + } + + static QJsonValue serialize(const double &value) + { + if (value == std::numeric_limits::infinity()) + { + return { deSerializerDoublePositiveInfinity }; + } + if (value == -std::numeric_limits::infinity()) + { + return { deSerializerDoubleNegativeInfinity }; + } + if (std::isnan(value)) + { + return { deSerializerDoubleNAN }; + } + return { value }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + template + class de_serializer> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static std::optional deserialize(const QJsonValue &json) + { + if (json.isNull()) + { + return std::nullopt; + } + return deserialize_json(json); + } + + static QJsonValue serialize(const std::optional &value) + { + if (value.has_value()) { + return serialize_json(*value); + } + return serialize_json(nullptr); + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + template + class de_serializer> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static std::vector deserialize(const QJsonValue &json) + { + if (!json.isArray()) + { + throw_json_type_conversion>(json.type()); + } + const QJsonArray ja = json.toArray(); + std::vector value; + value.reserve(ja.size()); + for (const auto item : ja) + { + value.push_back(deserialize_json(item)); + } + return value; + } + + static QJsonValue serialize(const std::vector &value) + { + QJsonArray ja; + for (const T &e : value) + { + ja.push_back(serialize_json(e)); + } + return { ja }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + template + class de_serializer> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static std::unordered_set deserialize(const QJsonValue &json) + { + if (!json.isArray()) + { + throw_json_type_conversion>(json.type()); + } + const QJsonArray ja = json.toArray(); + std::unordered_set value; + value.reserve(ja.size()); + for (const auto item : ja) + { + value.insert(deserialize_json(item)); + } + return value; + } + + static QJsonValue serialize(const std::unordered_set &value) + { + QJsonArray ja; + for (const T &e : value) + { + ja.push_back(serialize_json(e)); + } + return { ja }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + template + class de_serializer> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static std::map deserialize(const QJsonValue &json) + { + const QJsonObject jo = toJsonObject>(json); + std::map value; + // value.reserve(jo.size()); + for (auto it = jo.constBegin(), end = jo.constEnd(); it != end; ++it) + { + value[it.key()] = deserialize_json(it.value()); + } + return value; + } + + static QJsonValue serialize(const std::map &value) + { + QJsonObject jo; + for (const auto &[key, val] : value) + { + jo.insert(key, serialize_json(val)); + } + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // field (de)serialization + + template + class field_de_serializer final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static T deserialize(const QJsonObject &jo, const QString &key) + { + const auto it = jo.constFind(key); + if (it == jo.constEnd()) + { + throw_invalid_dto_exception(concat({ + u8"Error parsing JSON: key not found ", + to_std_string(key) + })); + } + return deserialize_json(it.value()); + } + + static void serialize(QJsonObject &json, const QString &key, const T &value) + { + json.insert(key, serialize_json(value)); + } + + field_de_serializer() = delete; + ~field_de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + template + static T deserialize_field(const QJsonObject &jo, const QString &key) + { + return field_de_serializer::deserialize(jo, key); + } + + template + static void serialize_field(QJsonObject &jo, const QString &key, const T &value) + { + field_de_serializer::serialize(jo, key, value); + } + + template + class field_de_serializer> final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static std::optional deserialize(const QJsonObject &jo, const QString &key) + { + const auto it = jo.constFind(key); + if (it == jo.constEnd()) + { + return std::nullopt; + } + const auto value = it.value(); + if (value.isNull()) + { + return std::nullopt; + } + return deserialize_json(value); + } + + static void serialize(QJsonObject &json, const QString &key, const std::optional &value) + { + if (value.has_value()) + { + serialize_field(json, key, *value); + } + } + + field_de_serializer() = delete; + ~field_de_serializer() = delete; + }; + + // any + + template<> + class de_serializer final + { + public: + static Any deserialize(const QJsonValue &json) + { + if (json.isNull()) + { + return Any(); + } + if (json.isString()) + { + return Any(deserialize_json(json)); + } + if (json.isDouble()) + { + return Any(deserialize_json(json)); + } + if (json.isObject()) + { + return Any(deserialize_json>(json)); + } + if (json.isArray()) + { + return Any(deserialize_json>(json)); + } + if (json.isBool()) + { + return Any(deserialize_json(json)); + } + throw std::domain_error(concat({ + u8"Unknown json value type: ", + to_std_string(json.type()) + })); + } + + static QJsonValue serialize(const Any &value) { + if (value.isNull()) + { + return serialize_json(nullptr); + } + if (value.isString()) + { + return serialize_json(value.getString()); + } + if (value.isDouble()) + { + return serialize_json(value.getDouble()); + } + if (value.isMap()) + { + return serialize_json(value.getMap()); + } + if (value.isList()) + { + return serialize_json(value.getList()); + } + if (value.isBool()) + { + return serialize_json(value.getBool()); + } + throw std::domain_error(u8"Unknown Axivion::Internal::Dto::any variant"); + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + Any Any::deserialize(const QByteArray &json) + { + return deserialize_bytes(json); + } + + Any::Any() {} + + Any::Any(QString value) : data(std::move(value)) {} + + Any::Any(double value) : data(std::move(value)) {} + + Any::Any(std::map value) : data(std::move(value)) {} + + Any::Any(std::vector value) : data(std::move(value)) {} + + Any::Any(bool value) : data(std::move(value)) {} + + bool Any::isNull() const + { + return this->data.index() == 0; + } + + bool Any::isString() const + { + return this->data.index() == 1; + } + + QString &Any::getString() + { + return std::get<1>(this->data); + } + + const QString &Any::getString() const { + return std::get<1>(this->data); + } + + bool Any::isDouble() const + { + return this->data.index() == 2; + } + + double &Any::getDouble() + { + return std::get<2>(this->data); + } + + const double &Any::getDouble() const + { + return std::get<2>(this->data); + } + + bool Any::isMap() const + { + return this->data.index() == 3; + } + + std::map &Any::getMap() + { + return std::get<3>(this->data); + } + + const std::map &Any::getMap() const + { + return std::get<3>(this->data); + } + + bool Any::isList() const + { + return this->data.index() == 4; + } + + std::vector &Any::getList() + { + return std::get<4>(this->data); + } + + const std::vector &Any::getList() const + { + return std::get<4>(this->data); + } + + bool Any::isBool() const + { + return this->data.index() == 5; + } + + bool &Any::getBool() + { + return std::get<5>(this->data); + } + + const bool &Any::getBool() const + { + return std::get<5>(this->data); + } + + QByteArray Any::serialize() const + { + return serialize_bytes(*this); + } + + // version + + constexpr std::array ApiVersion::number{7,6,2,12725}; + const QLatin1String ApiVersion::string{"7.6.2.12725"}; + const QLatin1String ApiVersion::name{"7.6.2"}; + const QLatin1String ApiVersion::timestamp{"2023-08-07 14:38:01 +00:00"}; + + // AnalyzedFileDto + + static const QLatin1String analyzedFileKeyPath{"path"}; + static const QLatin1String analyzedFileKeyIsSystemHeader{"isSystemHeader"}; + static const QLatin1String analyzedFileKeyLanguageName{"languageName"}; + + template<> + class de_serializer final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static AnalyzedFileDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject(json); + return { + deserialize_field(jo, analyzedFileKeyPath), + deserialize_field>(jo, analyzedFileKeyIsSystemHeader), + deserialize_field>(jo, analyzedFileKeyLanguageName) + }; + } + + static QJsonValue serialize(const AnalyzedFileDto &value) { + QJsonObject jo; + serialize_field(jo, analyzedFileKeyPath, value.path); + serialize_field(jo, analyzedFileKeyIsSystemHeader, value.isSystemHeader); + serialize_field(jo, analyzedFileKeyLanguageName, value.languageName); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + AnalyzedFileDto AnalyzedFileDto::deserialize(const QByteArray &json) + { + return deserialize_bytes(json); + } + + AnalyzedFileDto::AnalyzedFileDto( + QString path, + std::optional isSystemHeader, + std::optional languageName + ) : + path(std::move(path)), + isSystemHeader(std::move(isSystemHeader)), + languageName(std::move(languageName)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray AnalyzedFileDto::serialize() const + { + return serialize_bytes(*this); + } + + // ApiTokenType + + const QLatin1String ApiTokenTypeMeta::sourcefetch{"SourceFetch"}; + const QLatin1String ApiTokenTypeMeta::general{"General"}; + const QLatin1String ApiTokenTypeMeta::ideplugin{"IdePlugin"}; + const QLatin1String ApiTokenTypeMeta::login{"LogIn"}; + const QLatin1String ApiTokenTypeMeta::continuousintegration{"ContinuousIntegration"}; + + // throws std::range_error + ApiTokenType ApiTokenTypeMeta::strToEnum(QAnyStringView str) + { + if (str == ApiTokenTypeMeta::sourcefetch) + { + return ApiTokenType::sourcefetch; + } + if (str == ApiTokenTypeMeta::general) + { + return ApiTokenType::general; + } + if (str == ApiTokenTypeMeta::ideplugin) + { + return ApiTokenType::ideplugin; + } + if (str == ApiTokenTypeMeta::login) + { + return ApiTokenType::login; + } + if (str == ApiTokenTypeMeta::continuousintegration) + { + return ApiTokenType::continuousintegration; + } + throw std::range_error(concat({ u8"Unknown ApiTokenType str: ", to_std_string(str) })); + } + + QLatin1String ApiTokenTypeMeta::enumToStr(ApiTokenType e) + { + switch (e) + { + case ApiTokenType::sourcefetch: + return ApiTokenTypeMeta::sourcefetch; + case ApiTokenType::general: + return ApiTokenTypeMeta::general; + case ApiTokenType::ideplugin: + return ApiTokenTypeMeta::ideplugin; + case ApiTokenType::login: + return ApiTokenTypeMeta::login; + case ApiTokenType::continuousintegration: + return ApiTokenTypeMeta::continuousintegration;; + default: + throw std::domain_error(concat({ + u8"Unknown ApiTokenType enum: ", + to_std_string(static_cast(e)) + })); + } + } + + // ChangePasswordFormDto + + static const QLatin1String changePasswordFormKeyCurrentPassword{"currentPassword"}; + static const QLatin1String changePasswordFormKeyNewPassword{"newPassword"}; + + template<> + class de_serializer final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static ChangePasswordFormDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject(json); + return { + deserialize_field(jo, changePasswordFormKeyCurrentPassword), + deserialize_field(jo, changePasswordFormKeyNewPassword) + }; + } + + static QJsonValue serialize(const ChangePasswordFormDto &value) { + QJsonObject jo; + serialize_field(jo, changePasswordFormKeyCurrentPassword, value.currentPassword); + serialize_field(jo, changePasswordFormKeyNewPassword, value.newPassword); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + ChangePasswordFormDto ChangePasswordFormDto::deserialize(const QByteArray &json) + { + return deserialize_bytes(json); + } + + ChangePasswordFormDto::ChangePasswordFormDto( + QString currentPassword, + QString newPassword + ) : + currentPassword(std::move(currentPassword)), + newPassword(std::move(newPassword)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray ChangePasswordFormDto::serialize() const + { + return serialize_bytes(*this); + } + + // ColumnTypeOptionDto + + static const QLatin1String columnTypeOptionKeyKey{"key"}; + static const QLatin1String columnTypeOptionKeyDisplayName{"displayName"}; + static const QLatin1String columnTypeOptionKeyDisplayColor{"displayColor"}; + + template<> + class de_serializer final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static ColumnTypeOptionDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject(json); + return { + deserialize_field(jo, columnTypeOptionKeyKey), + deserialize_field>(jo, columnTypeOptionKeyDisplayName), + deserialize_field(jo, columnTypeOptionKeyDisplayColor) + }; + } + + static QJsonValue serialize(const ColumnTypeOptionDto &value) { + QJsonObject jo; + serialize_field(jo, columnTypeOptionKeyKey, value.key); + serialize_field(jo, columnTypeOptionKeyDisplayName, value.displayName); + serialize_field(jo, columnTypeOptionKeyDisplayColor, value.displayColor); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + ColumnTypeOptionDto ColumnTypeOptionDto::deserialize(const QByteArray &json) + { + return deserialize_bytes(json); + } + + ColumnTypeOptionDto::ColumnTypeOptionDto( + QString key, + std::optional displayName, + QString displayColor + ) : + key(std::move(key)), + displayName(std::move(displayName)), + displayColor(std::move(displayColor)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray ColumnTypeOptionDto::serialize() const + { + return serialize_bytes(*this); + } + + // CommentRequestDto + + static const QLatin1String commentRequestKeyText{"text"}; + + template<> + class de_serializer final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static CommentRequestDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject(json); + return { + deserialize_field(jo, commentRequestKeyText) + }; + } + + static QJsonValue serialize(const CommentRequestDto &value) { + QJsonObject jo; + serialize_field(jo, commentRequestKeyText, value.text); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + CommentRequestDto CommentRequestDto::deserialize(const QByteArray &json) + { + return deserialize_bytes(json); + } + + CommentRequestDto::CommentRequestDto( + QString text + ) : + text(std::move(text)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray CommentRequestDto::serialize() const + { + return serialize_bytes(*this); + } + + // EntityDto + + static const QLatin1String entityKeyId{"id"}; + static const QLatin1String entityKeyName{"name"}; + static const QLatin1String entityKeyType{"type"}; + static const QLatin1String entityKeyPath{"path"}; + static const QLatin1String entityKeyLine{"line"}; + + template<> + class de_serializer final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static EntityDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject(json); + return { + deserialize_field(jo, entityKeyId), + deserialize_field(jo, entityKeyName), + deserialize_field(jo, entityKeyType), + deserialize_field>(jo, entityKeyPath), + deserialize_field>(jo, entityKeyLine) + }; + } + + static QJsonValue serialize(const EntityDto &value) { + QJsonObject jo; + serialize_field(jo, entityKeyId, value.id); + serialize_field(jo, entityKeyName, value.name); + serialize_field(jo, entityKeyType, value.type); + serialize_field(jo, entityKeyPath, value.path); + serialize_field(jo, entityKeyLine, value.line); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + EntityDto EntityDto::deserialize(const QByteArray &json) + { + return deserialize_bytes(json); + } + + EntityDto::EntityDto( + QString id, + QString name, + QString type, + std::optional path, + std::optional line + ) : + id(std::move(id)), + name(std::move(name)), + type(std::move(type)), + path(std::move(path)), + line(std::move(line)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray EntityDto::serialize() const + { + return serialize_bytes(*this); + } + + // ErrorDto + + static const QLatin1String errorKeyDashboardVersionNumber{"dashboardVersionNumber"}; + static const QLatin1String errorKeyType{"type"}; + static const QLatin1String errorKeyMessage{"message"}; + static const QLatin1String errorKeyLocalizedMessage{"localizedMessage"}; + static const QLatin1String errorKeyDetails{"details"}; + static const QLatin1String errorKeyLocalizedDetails{"localizedDetails"}; + static const QLatin1String errorKeySupportAddress{"supportAddress"}; + static const QLatin1String errorKeyDisplayServerBugHint{"displayServerBugHint"}; + static const QLatin1String errorKeyData{"data"}; + + template<> + class de_serializer final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static ErrorDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject(json); + return { + deserialize_field>(jo, errorKeyDashboardVersionNumber), + deserialize_field(jo, errorKeyType), + deserialize_field(jo, errorKeyMessage), + deserialize_field(jo, errorKeyLocalizedMessage), + deserialize_field>(jo, errorKeyDetails), + deserialize_field>(jo, errorKeyLocalizedDetails), + deserialize_field>(jo, errorKeySupportAddress), + deserialize_field>(jo, errorKeyDisplayServerBugHint), + deserialize_field>>(jo, errorKeyData) + }; + } + + static QJsonValue serialize(const ErrorDto &value) { + QJsonObject jo; + serialize_field(jo, errorKeyDashboardVersionNumber, value.dashboardVersionNumber); + serialize_field(jo, errorKeyType, value.type); + serialize_field(jo, errorKeyMessage, value.message); + serialize_field(jo, errorKeyLocalizedMessage, value.localizedMessage); + serialize_field(jo, errorKeyDetails, value.details); + serialize_field(jo, errorKeyLocalizedDetails, value.localizedDetails); + serialize_field(jo, errorKeySupportAddress, value.supportAddress); + serialize_field(jo, errorKeyDisplayServerBugHint, value.displayServerBugHint); + serialize_field(jo, errorKeyData, value.data); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + ErrorDto ErrorDto::deserialize(const QByteArray &json) + { + return deserialize_bytes(json); + } + + ErrorDto::ErrorDto( + std::optional dashboardVersionNumber, + QString type, + QString message, + QString localizedMessage, + std::optional details, + std::optional localizedDetails, + std::optional supportAddress, + std::optional displayServerBugHint, + std::optional> data + ) : + dashboardVersionNumber(std::move(dashboardVersionNumber)), + type(std::move(type)), + message(std::move(message)), + localizedMessage(std::move(localizedMessage)), + details(std::move(details)), + localizedDetails(std::move(localizedDetails)), + supportAddress(std::move(supportAddress)), + displayServerBugHint(std::move(displayServerBugHint)), + data(std::move(data)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray ErrorDto::serialize() const + { + return serialize_bytes(*this); + } + + // IssueCommentDto + + static const QLatin1String issueCommentKeyUsername{"username"}; + static const QLatin1String issueCommentKeyUserDisplayName{"userDisplayName"}; + static const QLatin1String issueCommentKeyDate{"date"}; + static const QLatin1String issueCommentKeyDisplayDate{"displayDate"}; + static const QLatin1String issueCommentKeyText{"text"}; + static const QLatin1String issueCommentKeyHtml{"html"}; + static const QLatin1String issueCommentKeyCommentDeletionId{"commentDeletionId"}; + + template<> + class de_serializer final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static IssueCommentDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject(json); + return { + deserialize_field(jo, issueCommentKeyUsername), + deserialize_field(jo, issueCommentKeyUserDisplayName), + deserialize_field(jo, issueCommentKeyDate), + deserialize_field(jo, issueCommentKeyDisplayDate), + deserialize_field(jo, issueCommentKeyText), + deserialize_field>(jo, issueCommentKeyHtml), + deserialize_field>(jo, issueCommentKeyCommentDeletionId) + }; + } + + static QJsonValue serialize(const IssueCommentDto &value) { + QJsonObject jo; + serialize_field(jo, issueCommentKeyUsername, value.username); + serialize_field(jo, issueCommentKeyUserDisplayName, value.userDisplayName); + serialize_field(jo, issueCommentKeyDate, value.date); + serialize_field(jo, issueCommentKeyDisplayDate, value.displayDate); + serialize_field(jo, issueCommentKeyText, value.text); + serialize_field(jo, issueCommentKeyHtml, value.html); + serialize_field(jo, issueCommentKeyCommentDeletionId, value.commentDeletionId); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + IssueCommentDto IssueCommentDto::deserialize(const QByteArray &json) + { + return deserialize_bytes(json); + } + + IssueCommentDto::IssueCommentDto( + QString username, + QString userDisplayName, + QString date, + QString displayDate, + QString text, + std::optional html, + std::optional commentDeletionId + ) : + username(std::move(username)), + userDisplayName(std::move(userDisplayName)), + date(std::move(date)), + displayDate(std::move(displayDate)), + text(std::move(text)), + html(std::move(html)), + commentDeletionId(std::move(commentDeletionId)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray IssueCommentDto::serialize() const + { + return serialize_bytes(*this); + } + + // IssueKind + + const QLatin1String IssueKindMeta::av{"AV"}; + const QLatin1String IssueKindMeta::cl{"CL"}; + const QLatin1String IssueKindMeta::cy{"CY"}; + const QLatin1String IssueKindMeta::de{"DE"}; + const QLatin1String IssueKindMeta::mv{"MV"}; + const QLatin1String IssueKindMeta::sv{"SV"}; + + // throws std::range_error + IssueKind IssueKindMeta::strToEnum(QAnyStringView str) + { + if (str == IssueKindMeta::av) + { + return IssueKind::av; + } + if (str == IssueKindMeta::cl) + { + return IssueKind::cl; + } + if (str == IssueKindMeta::cy) + { + return IssueKind::cy; + } + if (str == IssueKindMeta::de) + { + return IssueKind::de; + } + if (str == IssueKindMeta::mv) + { + return IssueKind::mv; + } + if (str == IssueKindMeta::sv) + { + return IssueKind::sv; + } + throw std::range_error(concat({ u8"Unknown IssueKind str: ", to_std_string(str) })); + } + + QLatin1String IssueKindMeta::enumToStr(IssueKind e) + { + switch (e) + { + case IssueKind::av: + return IssueKindMeta::av; + case IssueKind::cl: + return IssueKindMeta::cl; + case IssueKind::cy: + return IssueKindMeta::cy; + case IssueKind::de: + return IssueKindMeta::de; + case IssueKind::mv: + return IssueKindMeta::mv; + case IssueKind::sv: + return IssueKindMeta::sv;; + default: + throw std::domain_error(concat({ + u8"Unknown IssueKind enum: ", + to_std_string(static_cast(e)) + })); + } + } + + // IssueKindForNamedFilterCreation + + const QLatin1String IssueKindForNamedFilterCreationMeta::av{"AV"}; + const QLatin1String IssueKindForNamedFilterCreationMeta::cl{"CL"}; + const QLatin1String IssueKindForNamedFilterCreationMeta::cy{"CY"}; + const QLatin1String IssueKindForNamedFilterCreationMeta::de{"DE"}; + const QLatin1String IssueKindForNamedFilterCreationMeta::mv{"MV"}; + const QLatin1String IssueKindForNamedFilterCreationMeta::sv{"SV"}; + const QLatin1String IssueKindForNamedFilterCreationMeta::universal{"UNIVERSAL"}; + + // throws std::range_error + IssueKindForNamedFilterCreation IssueKindForNamedFilterCreationMeta::strToEnum(QAnyStringView str) + { + if (str == IssueKindForNamedFilterCreationMeta::av) + { + return IssueKindForNamedFilterCreation::av; + } + if (str == IssueKindForNamedFilterCreationMeta::cl) + { + return IssueKindForNamedFilterCreation::cl; + } + if (str == IssueKindForNamedFilterCreationMeta::cy) + { + return IssueKindForNamedFilterCreation::cy; + } + if (str == IssueKindForNamedFilterCreationMeta::de) + { + return IssueKindForNamedFilterCreation::de; + } + if (str == IssueKindForNamedFilterCreationMeta::mv) + { + return IssueKindForNamedFilterCreation::mv; + } + if (str == IssueKindForNamedFilterCreationMeta::sv) + { + return IssueKindForNamedFilterCreation::sv; + } + if (str == IssueKindForNamedFilterCreationMeta::universal) + { + return IssueKindForNamedFilterCreation::universal; + } + throw std::range_error(concat({ u8"Unknown IssueKindForNamedFilterCreation str: ", to_std_string(str) })); + } + + QLatin1String IssueKindForNamedFilterCreationMeta::enumToStr(IssueKindForNamedFilterCreation e) + { + switch (e) + { + case IssueKindForNamedFilterCreation::av: + return IssueKindForNamedFilterCreationMeta::av; + case IssueKindForNamedFilterCreation::cl: + return IssueKindForNamedFilterCreationMeta::cl; + case IssueKindForNamedFilterCreation::cy: + return IssueKindForNamedFilterCreationMeta::cy; + case IssueKindForNamedFilterCreation::de: + return IssueKindForNamedFilterCreationMeta::de; + case IssueKindForNamedFilterCreation::mv: + return IssueKindForNamedFilterCreationMeta::mv; + case IssueKindForNamedFilterCreation::sv: + return IssueKindForNamedFilterCreationMeta::sv; + case IssueKindForNamedFilterCreation::universal: + return IssueKindForNamedFilterCreationMeta::universal;; + default: + throw std::domain_error(concat({ + u8"Unknown IssueKindForNamedFilterCreation enum: ", + to_std_string(static_cast(e)) + })); + } + } + + // IssueSourceLocationDto + + static const QLatin1String issueSourceLocationKeyFileName{"fileName"}; + static const QLatin1String issueSourceLocationKeyRole{"role"}; + static const QLatin1String issueSourceLocationKeySourceCodeUrl{"sourceCodeUrl"}; + static const QLatin1String issueSourceLocationKeyStartLine{"startLine"}; + static const QLatin1String issueSourceLocationKeyStartColumn{"startColumn"}; + static const QLatin1String issueSourceLocationKeyEndLine{"endLine"}; + static const QLatin1String issueSourceLocationKeyEndColumn{"endColumn"}; + + template<> + class de_serializer final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static IssueSourceLocationDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject(json); + return { + deserialize_field(jo, issueSourceLocationKeyFileName), + deserialize_field>(jo, issueSourceLocationKeyRole), + deserialize_field(jo, issueSourceLocationKeySourceCodeUrl), + deserialize_field(jo, issueSourceLocationKeyStartLine), + deserialize_field(jo, issueSourceLocationKeyStartColumn), + deserialize_field(jo, issueSourceLocationKeyEndLine), + deserialize_field(jo, issueSourceLocationKeyEndColumn) + }; + } + + static QJsonValue serialize(const IssueSourceLocationDto &value) { + QJsonObject jo; + serialize_field(jo, issueSourceLocationKeyFileName, value.fileName); + serialize_field(jo, issueSourceLocationKeyRole, value.role); + serialize_field(jo, issueSourceLocationKeySourceCodeUrl, value.sourceCodeUrl); + serialize_field(jo, issueSourceLocationKeyStartLine, value.startLine); + serialize_field(jo, issueSourceLocationKeyStartColumn, value.startColumn); + serialize_field(jo, issueSourceLocationKeyEndLine, value.endLine); + serialize_field(jo, issueSourceLocationKeyEndColumn, value.endColumn); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + IssueSourceLocationDto IssueSourceLocationDto::deserialize(const QByteArray &json) + { + return deserialize_bytes(json); + } + + IssueSourceLocationDto::IssueSourceLocationDto( + QString fileName, + std::optional role, + QString sourceCodeUrl, + qint32 startLine, + qint32 startColumn, + qint32 endLine, + qint32 endColumn + ) : + fileName(std::move(fileName)), + role(std::move(role)), + sourceCodeUrl(std::move(sourceCodeUrl)), + startLine(std::move(startLine)), + startColumn(std::move(startColumn)), + endLine(std::move(endLine)), + endColumn(std::move(endColumn)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray IssueSourceLocationDto::serialize() const + { + return serialize_bytes(*this); + } + + // IssueTagDto + + static const QLatin1String issueTagKeyTag{"tag"}; + static const QLatin1String issueTagKeyColor{"color"}; + + template<> + class de_serializer final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static IssueTagDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject(json); + return { + deserialize_field(jo, issueTagKeyTag), + deserialize_field(jo, issueTagKeyColor) + }; + } + + static QJsonValue serialize(const IssueTagDto &value) { + QJsonObject jo; + serialize_field(jo, issueTagKeyTag, value.tag); + serialize_field(jo, issueTagKeyColor, value.color); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + IssueTagDto IssueTagDto::deserialize(const QByteArray &json) + { + return deserialize_bytes(json); + } + + IssueTagDto::IssueTagDto( + QString tag, + QString color + ) : + tag(std::move(tag)), + color(std::move(color)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray IssueTagDto::serialize() const + { + return serialize_bytes(*this); + } + + // IssueTagTypeDto + + static const QLatin1String issueTagTypeKeyId{"id"}; + static const QLatin1String issueTagTypeKeyText{"text"}; + static const QLatin1String issueTagTypeKeyTag{"tag"}; + static const QLatin1String issueTagTypeKeyColor{"color"}; + static const QLatin1String issueTagTypeKeyDescription{"description"}; + static const QLatin1String issueTagTypeKeySelected{"selected"}; + + template<> + class de_serializer final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static IssueTagTypeDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject(json); + return { + deserialize_field(jo, issueTagTypeKeyId), + deserialize_field>(jo, issueTagTypeKeyText), + deserialize_field>(jo, issueTagTypeKeyTag), + deserialize_field(jo, issueTagTypeKeyColor), + deserialize_field>(jo, issueTagTypeKeyDescription), + deserialize_field>(jo, issueTagTypeKeySelected) + }; + } + + static QJsonValue serialize(const IssueTagTypeDto &value) { + QJsonObject jo; + serialize_field(jo, issueTagTypeKeyId, value.id); + serialize_field(jo, issueTagTypeKeyText, value.text); + serialize_field(jo, issueTagTypeKeyTag, value.tag); + serialize_field(jo, issueTagTypeKeyColor, value.color); + serialize_field(jo, issueTagTypeKeyDescription, value.description); + serialize_field(jo, issueTagTypeKeySelected, value.selected); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + IssueTagTypeDto IssueTagTypeDto::deserialize(const QByteArray &json) + { + return deserialize_bytes(json); + } + + IssueTagTypeDto::IssueTagTypeDto( + QString id, + std::optional text, + std::optional tag, + QString color, + std::optional description, + std::optional selected + ) : + id(std::move(id)), + text(std::move(text)), + tag(std::move(tag)), + color(std::move(color)), + description(std::move(description)), + selected(std::move(selected)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray IssueTagTypeDto::serialize() const + { + return serialize_bytes(*this); + } + + // MessageSeverity + + const QLatin1String MessageSeverityMeta::debug{"DEBUG"}; + const QLatin1String MessageSeverityMeta::info{"INFO"}; + const QLatin1String MessageSeverityMeta::warning{"WARNING"}; + const QLatin1String MessageSeverityMeta::error{"ERROR"}; + const QLatin1String MessageSeverityMeta::fatal{"FATAL"}; + + // throws std::range_error + MessageSeverity MessageSeverityMeta::strToEnum(QAnyStringView str) + { + if (str == MessageSeverityMeta::debug) + { + return MessageSeverity::debug; + } + if (str == MessageSeverityMeta::info) + { + return MessageSeverity::info; + } + if (str == MessageSeverityMeta::warning) + { + return MessageSeverity::warning; + } + if (str == MessageSeverityMeta::error) + { + return MessageSeverity::error; + } + if (str == MessageSeverityMeta::fatal) + { + return MessageSeverity::fatal; + } + throw std::range_error(concat({ u8"Unknown MessageSeverity str: ", to_std_string(str) })); + } + + QLatin1String MessageSeverityMeta::enumToStr(MessageSeverity e) + { + switch (e) + { + case MessageSeverity::debug: + return MessageSeverityMeta::debug; + case MessageSeverity::info: + return MessageSeverityMeta::info; + case MessageSeverity::warning: + return MessageSeverityMeta::warning; + case MessageSeverity::error: + return MessageSeverityMeta::error; + case MessageSeverity::fatal: + return MessageSeverityMeta::fatal;; + default: + throw std::domain_error(concat({ + u8"Unknown MessageSeverity enum: ", + to_std_string(static_cast(e)) + })); + } + } + + // MetricDto + + static const QLatin1String metricKeyName{"name"}; + static const QLatin1String metricKeyDisplayName{"displayName"}; + static const QLatin1String metricKeyMinValue{"minValue"}; + static const QLatin1String metricKeyMaxValue{"maxValue"}; + + template<> + class de_serializer final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static MetricDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject(json); + return { + deserialize_field(jo, metricKeyName), + deserialize_field(jo, metricKeyDisplayName), + deserialize_field(jo, metricKeyMinValue), + deserialize_field(jo, metricKeyMaxValue) + }; + } + + static QJsonValue serialize(const MetricDto &value) { + QJsonObject jo; + serialize_field(jo, metricKeyName, value.name); + serialize_field(jo, metricKeyDisplayName, value.displayName); + serialize_field(jo, metricKeyMinValue, value.minValue); + serialize_field(jo, metricKeyMaxValue, value.maxValue); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + MetricDto MetricDto::deserialize(const QByteArray &json) + { + return deserialize_bytes(json); + } + + MetricDto::MetricDto( + QString name, + QString displayName, + Any minValue, + Any maxValue + ) : + name(std::move(name)), + displayName(std::move(displayName)), + minValue(std::move(minValue)), + maxValue(std::move(maxValue)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray MetricDto::serialize() const + { + return serialize_bytes(*this); + } + + // MetricValueTableRowDto + + static const QLatin1String metricValueTableRowKeyMetric{"metric"}; + static const QLatin1String metricValueTableRowKeyPath{"path"}; + static const QLatin1String metricValueTableRowKeyLine{"line"}; + static const QLatin1String metricValueTableRowKeyValue{"value"}; + static const QLatin1String metricValueTableRowKeyEntity{"entity"}; + static const QLatin1String metricValueTableRowKeyEntityType{"entityType"}; + static const QLatin1String metricValueTableRowKeyEntityId{"entityId"}; + + template<> + class de_serializer final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static MetricValueTableRowDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject(json); + return { + deserialize_field(jo, metricValueTableRowKeyMetric), + deserialize_field>(jo, metricValueTableRowKeyPath), + deserialize_field>(jo, metricValueTableRowKeyLine), + deserialize_field>(jo, metricValueTableRowKeyValue), + deserialize_field(jo, metricValueTableRowKeyEntity), + deserialize_field(jo, metricValueTableRowKeyEntityType), + deserialize_field(jo, metricValueTableRowKeyEntityId) + }; + } + + static QJsonValue serialize(const MetricValueTableRowDto &value) { + QJsonObject jo; + serialize_field(jo, metricValueTableRowKeyMetric, value.metric); + serialize_field(jo, metricValueTableRowKeyPath, value.path); + serialize_field(jo, metricValueTableRowKeyLine, value.line); + serialize_field(jo, metricValueTableRowKeyValue, value.value); + serialize_field(jo, metricValueTableRowKeyEntity, value.entity); + serialize_field(jo, metricValueTableRowKeyEntityType, value.entityType); + serialize_field(jo, metricValueTableRowKeyEntityId, value.entityId); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + MetricValueTableRowDto MetricValueTableRowDto::deserialize(const QByteArray &json) + { + return deserialize_bytes(json); + } + + MetricValueTableRowDto::MetricValueTableRowDto( + QString metric, + std::optional path, + std::optional line, + std::optional value, + QString entity, + QString entityType, + QString entityId + ) : + metric(std::move(metric)), + path(std::move(path)), + line(std::move(line)), + value(std::move(value)), + entity(std::move(entity)), + entityType(std::move(entityType)), + entityId(std::move(entityId)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray MetricValueTableRowDto::serialize() const + { + return serialize_bytes(*this); + } + + // NamedFilterType + + const QLatin1String NamedFilterTypeMeta::predefined{"PREDEFINED"}; + const QLatin1String NamedFilterTypeMeta::global{"GLOBAL"}; + const QLatin1String NamedFilterTypeMeta::custom{"CUSTOM"}; + + // throws std::range_error + NamedFilterType NamedFilterTypeMeta::strToEnum(QAnyStringView str) + { + if (str == NamedFilterTypeMeta::predefined) + { + return NamedFilterType::predefined; + } + if (str == NamedFilterTypeMeta::global) + { + return NamedFilterType::global; + } + if (str == NamedFilterTypeMeta::custom) + { + return NamedFilterType::custom; + } + throw std::range_error(concat({ u8"Unknown NamedFilterType str: ", to_std_string(str) })); + } + + QLatin1String NamedFilterTypeMeta::enumToStr(NamedFilterType e) + { + switch (e) + { + case NamedFilterType::predefined: + return NamedFilterTypeMeta::predefined; + case NamedFilterType::global: + return NamedFilterTypeMeta::global; + case NamedFilterType::custom: + return NamedFilterTypeMeta::custom;; + default: + throw std::domain_error(concat({ + u8"Unknown NamedFilterType enum: ", + to_std_string(static_cast(e)) + })); + } + } + + // NamedFilterVisibilityDto + + static const QLatin1String namedFilterVisibilityKeyGroups{"groups"}; + + template<> + class de_serializer final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static NamedFilterVisibilityDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject(json); + return { + deserialize_field>>(jo, namedFilterVisibilityKeyGroups) + }; + } + + static QJsonValue serialize(const NamedFilterVisibilityDto &value) { + QJsonObject jo; + serialize_field(jo, namedFilterVisibilityKeyGroups, value.groups); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + NamedFilterVisibilityDto NamedFilterVisibilityDto::deserialize(const QByteArray &json) + { + return deserialize_bytes(json); + } + + NamedFilterVisibilityDto::NamedFilterVisibilityDto( + std::optional> groups + ) : + groups(std::move(groups)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray NamedFilterVisibilityDto::serialize() const + { + return serialize_bytes(*this); + } + + // ProjectReferenceDto + + static const QLatin1String projectReferenceKeyName{"name"}; + static const QLatin1String projectReferenceKeyUrl{"url"}; + + template<> + class de_serializer final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static ProjectReferenceDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject(json); + return { + deserialize_field(jo, projectReferenceKeyName), + deserialize_field(jo, projectReferenceKeyUrl) + }; + } + + static QJsonValue serialize(const ProjectReferenceDto &value) { + QJsonObject jo; + serialize_field(jo, projectReferenceKeyName, value.name); + serialize_field(jo, projectReferenceKeyUrl, value.url); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + ProjectReferenceDto ProjectReferenceDto::deserialize(const QByteArray &json) + { + return deserialize_bytes(json); + } + + ProjectReferenceDto::ProjectReferenceDto( + QString name, + QString url + ) : + name(std::move(name)), + url(std::move(url)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray ProjectReferenceDto::serialize() const + { + return serialize_bytes(*this); + } + + // RuleDto + + static const QLatin1String ruleKeyName{"name"}; + static const QLatin1String ruleKeyOriginal_name{"original_name"}; + static const QLatin1String ruleKeyDisabled{"disabled"}; + + template<> + class de_serializer final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static RuleDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject(json); + return { + deserialize_field(jo, ruleKeyName), + deserialize_field(jo, ruleKeyOriginal_name), + deserialize_field>(jo, ruleKeyDisabled) + }; + } + + static QJsonValue serialize(const RuleDto &value) { + QJsonObject jo; + serialize_field(jo, ruleKeyName, value.name); + serialize_field(jo, ruleKeyOriginal_name, value.original_name); + serialize_field(jo, ruleKeyDisabled, value.disabled); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + RuleDto RuleDto::deserialize(const QByteArray &json) + { + return deserialize_bytes(json); + } + + RuleDto::RuleDto( + QString name, + QString original_name, + std::optional disabled + ) : + name(std::move(name)), + original_name(std::move(original_name)), + disabled(std::move(disabled)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray RuleDto::serialize() const + { + return serialize_bytes(*this); + } + + // SortDirection + + const QLatin1String SortDirectionMeta::asc{"ASC"}; + const QLatin1String SortDirectionMeta::desc{"DESC"}; + + // throws std::range_error + SortDirection SortDirectionMeta::strToEnum(QAnyStringView str) + { + if (str == SortDirectionMeta::asc) + { + return SortDirection::asc; + } + if (str == SortDirectionMeta::desc) + { + return SortDirection::desc; + } + throw std::range_error(concat({ u8"Unknown SortDirection str: ", to_std_string(str) })); + } + + QLatin1String SortDirectionMeta::enumToStr(SortDirection e) + { + switch (e) + { + case SortDirection::asc: + return SortDirectionMeta::asc; + case SortDirection::desc: + return SortDirectionMeta::desc;; + default: + throw std::domain_error(concat({ + u8"Unknown SortDirection enum: ", + to_std_string(static_cast(e)) + })); + } + } + + // TableCellAlignment + + const QLatin1String TableCellAlignmentMeta::left{"left"}; + const QLatin1String TableCellAlignmentMeta::right{"right"}; + const QLatin1String TableCellAlignmentMeta::center{"center"}; + + // throws std::range_error + TableCellAlignment TableCellAlignmentMeta::strToEnum(QAnyStringView str) + { + if (str == TableCellAlignmentMeta::left) + { + return TableCellAlignment::left; + } + if (str == TableCellAlignmentMeta::right) + { + return TableCellAlignment::right; + } + if (str == TableCellAlignmentMeta::center) + { + return TableCellAlignment::center; + } + throw std::range_error(concat({ u8"Unknown TableCellAlignment str: ", to_std_string(str) })); + } + + QLatin1String TableCellAlignmentMeta::enumToStr(TableCellAlignment e) + { + switch (e) + { + case TableCellAlignment::left: + return TableCellAlignmentMeta::left; + case TableCellAlignment::right: + return TableCellAlignmentMeta::right; + case TableCellAlignment::center: + return TableCellAlignmentMeta::center;; + default: + throw std::domain_error(concat({ + u8"Unknown TableCellAlignment enum: ", + to_std_string(static_cast(e)) + })); + } + } + + // ToolsVersionDto + + static const QLatin1String toolsVersionKeyName{"name"}; + static const QLatin1String toolsVersionKeyNumber{"number"}; + static const QLatin1String toolsVersionKeyBuildDate{"buildDate"}; + + template<> + class de_serializer final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static ToolsVersionDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject(json); + return { + deserialize_field(jo, toolsVersionKeyName), + deserialize_field(jo, toolsVersionKeyNumber), + deserialize_field(jo, toolsVersionKeyBuildDate) + }; + } + + static QJsonValue serialize(const ToolsVersionDto &value) { + QJsonObject jo; + serialize_field(jo, toolsVersionKeyName, value.name); + serialize_field(jo, toolsVersionKeyNumber, value.number); + serialize_field(jo, toolsVersionKeyBuildDate, value.buildDate); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + ToolsVersionDto ToolsVersionDto::deserialize(const QByteArray &json) + { + return deserialize_bytes(json); + } + + ToolsVersionDto::ToolsVersionDto( + QString name, + QString number, + QString buildDate + ) : + name(std::move(name)), + number(std::move(number)), + buildDate(std::move(buildDate)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray ToolsVersionDto::serialize() const + { + return serialize_bytes(*this); + } + + // UserRefType + + const QLatin1String UserRefTypeMeta::virtual_user{"VIRTUAL_USER"}; + const QLatin1String UserRefTypeMeta::dashboard_user{"DASHBOARD_USER"}; + const QLatin1String UserRefTypeMeta::unmapped_user{"UNMAPPED_USER"}; + + // throws std::range_error + UserRefType UserRefTypeMeta::strToEnum(QAnyStringView str) + { + if (str == UserRefTypeMeta::virtual_user) + { + return UserRefType::virtual_user; + } + if (str == UserRefTypeMeta::dashboard_user) + { + return UserRefType::dashboard_user; + } + if (str == UserRefTypeMeta::unmapped_user) + { + return UserRefType::unmapped_user; + } + throw std::range_error(concat({ u8"Unknown UserRefType str: ", to_std_string(str) })); + } + + QLatin1String UserRefTypeMeta::enumToStr(UserRefType e) + { + switch (e) + { + case UserRefType::virtual_user: + return UserRefTypeMeta::virtual_user; + case UserRefType::dashboard_user: + return UserRefTypeMeta::dashboard_user; + case UserRefType::unmapped_user: + return UserRefTypeMeta::unmapped_user;; + default: + throw std::domain_error(concat({ + u8"Unknown UserRefType enum: ", + to_std_string(static_cast(e)) + })); + } + } + + // VersionKindCountDto + + static const QLatin1String versionKindCountKeyTotal{"Total"}; + static const QLatin1String versionKindCountKeyAdded{"Added"}; + static const QLatin1String versionKindCountKeyRemoved{"Removed"}; + + template<> + class de_serializer final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static VersionKindCountDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject(json); + return { + deserialize_field(jo, versionKindCountKeyTotal), + deserialize_field(jo, versionKindCountKeyAdded), + deserialize_field(jo, versionKindCountKeyRemoved) + }; + } + + static QJsonValue serialize(const VersionKindCountDto &value) { + QJsonObject jo; + serialize_field(jo, versionKindCountKeyTotal, value.Total); + serialize_field(jo, versionKindCountKeyAdded, value.Added); + serialize_field(jo, versionKindCountKeyRemoved, value.Removed); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + VersionKindCountDto VersionKindCountDto::deserialize(const QByteArray &json) + { + return deserialize_bytes(json); + } + + VersionKindCountDto::VersionKindCountDto( + qint32 Total, + qint32 Added, + qint32 Removed + ) : + Total(std::move(Total)), + Added(std::move(Added)), + Removed(std::move(Removed)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray VersionKindCountDto::serialize() const + { + return serialize_bytes(*this); + } + + // AnalysisVersionDto + + static const QLatin1String analysisVersionKeyDate{"date"}; + static const QLatin1String analysisVersionKeyLabel{"label"}; + static const QLatin1String analysisVersionKeyIndex{"index"}; + static const QLatin1String analysisVersionKeyName{"name"}; + static const QLatin1String analysisVersionKeyMillis{"millis"}; + static const QLatin1String analysisVersionKeyIssueCounts{"issueCounts"}; + static const QLatin1String analysisVersionKeyToolsVersion{"toolsVersion"}; + static const QLatin1String analysisVersionKeyLinesOfCode{"linesOfCode"}; + static const QLatin1String analysisVersionKeyCloneRatio{"cloneRatio"}; + + template<> + class de_serializer final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static AnalysisVersionDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject(json); + return { + deserialize_field(jo, analysisVersionKeyDate), + deserialize_field>(jo, analysisVersionKeyLabel), + deserialize_field(jo, analysisVersionKeyIndex), + deserialize_field>(jo, analysisVersionKeyName), + deserialize_field(jo, analysisVersionKeyMillis), + deserialize_field(jo, analysisVersionKeyIssueCounts), + deserialize_field>(jo, analysisVersionKeyToolsVersion), + deserialize_field>(jo, analysisVersionKeyLinesOfCode), + deserialize_field>(jo, analysisVersionKeyCloneRatio) + }; + } + + static QJsonValue serialize(const AnalysisVersionDto &value) { + QJsonObject jo; + serialize_field(jo, analysisVersionKeyDate, value.date); + serialize_field(jo, analysisVersionKeyLabel, value.label); + serialize_field(jo, analysisVersionKeyIndex, value.index); + serialize_field(jo, analysisVersionKeyName, value.name); + serialize_field(jo, analysisVersionKeyMillis, value.millis); + serialize_field(jo, analysisVersionKeyIssueCounts, value.issueCounts); + serialize_field(jo, analysisVersionKeyToolsVersion, value.toolsVersion); + serialize_field(jo, analysisVersionKeyLinesOfCode, value.linesOfCode); + serialize_field(jo, analysisVersionKeyCloneRatio, value.cloneRatio); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + AnalysisVersionDto AnalysisVersionDto::deserialize(const QByteArray &json) + { + return deserialize_bytes(json); + } + + AnalysisVersionDto::AnalysisVersionDto( + QString date, + std::optional label, + qint32 index, + std::optional name, + qint64 millis, + Any issueCounts, + std::optional toolsVersion, + std::optional linesOfCode, + std::optional cloneRatio + ) : + date(std::move(date)), + label(std::move(label)), + index(std::move(index)), + name(std::move(name)), + millis(std::move(millis)), + issueCounts(std::move(issueCounts)), + toolsVersion(std::move(toolsVersion)), + linesOfCode(std::move(linesOfCode)), + cloneRatio(std::move(cloneRatio)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray AnalysisVersionDto::serialize() const + { + return serialize_bytes(*this); + } + + // ApiTokenCreationRequestDto + + static const QLatin1String apiTokenCreationRequestKeyPassword{"password"}; + static const QLatin1String apiTokenCreationRequestKeyType{"type"}; + static const QLatin1String apiTokenCreationRequestKeyDescription{"description"}; + static const QLatin1String apiTokenCreationRequestKeyMaxAgeMillis{"maxAgeMillis"}; + + template<> + class de_serializer final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static ApiTokenCreationRequestDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject(json); + return { + deserialize_field(jo, apiTokenCreationRequestKeyPassword), + deserialize_field(jo, apiTokenCreationRequestKeyType), + deserialize_field(jo, apiTokenCreationRequestKeyDescription), + deserialize_field(jo, apiTokenCreationRequestKeyMaxAgeMillis) + }; + } + + static QJsonValue serialize(const ApiTokenCreationRequestDto &value) { + QJsonObject jo; + serialize_field(jo, apiTokenCreationRequestKeyPassword, value.password); + serialize_field(jo, apiTokenCreationRequestKeyType, value.type); + serialize_field(jo, apiTokenCreationRequestKeyDescription, value.description); + serialize_field(jo, apiTokenCreationRequestKeyMaxAgeMillis, value.maxAgeMillis); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + ApiTokenCreationRequestDto ApiTokenCreationRequestDto::deserialize(const QByteArray &json) + { + return deserialize_bytes(json); + } + + ApiTokenCreationRequestDto::ApiTokenCreationRequestDto( + QString password, + QString type, + QString description, + qint64 maxAgeMillis + ) : + password(std::move(password)), + type(std::move(type)), + description(std::move(description)), + maxAgeMillis(std::move(maxAgeMillis)) + { } + + ApiTokenCreationRequestDto::ApiTokenCreationRequestDto( + QString password, + ApiTokenType type, + QString description, + qint64 maxAgeMillis + ) : ApiTokenCreationRequestDto( + std::move(password), + ApiTokenTypeMeta::enumToStr(type), + std::move(description), + std::move(maxAgeMillis)) + { } + + // throws std::range_error + ApiTokenType ApiTokenCreationRequestDto::getTypeEnum() const + { + return ApiTokenTypeMeta::strToEnum(type); + } + + void ApiTokenCreationRequestDto::setTypeEnum(ApiTokenType newValue) + { + type = ApiTokenTypeMeta::enumToStr(newValue); + } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray ApiTokenCreationRequestDto::serialize() const + { + return serialize_bytes(*this); + } + + // ApiTokenInfoDto + + static const QLatin1String apiTokenInfoKeyId{"id"}; + static const QLatin1String apiTokenInfoKeyUrl{"url"}; + static const QLatin1String apiTokenInfoKeyIsValid{"isValid"}; + static const QLatin1String apiTokenInfoKeyType{"type"}; + static const QLatin1String apiTokenInfoKeyDescription{"description"}; + static const QLatin1String apiTokenInfoKeyToken{"token"}; + static const QLatin1String apiTokenInfoKeyCreationDate{"creationDate"}; + static const QLatin1String apiTokenInfoKeyDisplayCreationDate{"displayCreationDate"}; + static const QLatin1String apiTokenInfoKeyExpirationDate{"expirationDate"}; + static const QLatin1String apiTokenInfoKeyDisplayExpirationDate{"displayExpirationDate"}; + static const QLatin1String apiTokenInfoKeyLastUseDate{"lastUseDate"}; + static const QLatin1String apiTokenInfoKeyDisplayLastUseDate{"displayLastUseDate"}; + static const QLatin1String apiTokenInfoKeyUsedByCurrentRequest{"usedByCurrentRequest"}; + + template<> + class de_serializer final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static ApiTokenInfoDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject(json); + return { + deserialize_field(jo, apiTokenInfoKeyId), + deserialize_field(jo, apiTokenInfoKeyUrl), + deserialize_field(jo, apiTokenInfoKeyIsValid), + deserialize_field(jo, apiTokenInfoKeyType), + deserialize_field(jo, apiTokenInfoKeyDescription), + deserialize_field>(jo, apiTokenInfoKeyToken), + deserialize_field(jo, apiTokenInfoKeyCreationDate), + deserialize_field(jo, apiTokenInfoKeyDisplayCreationDate), + deserialize_field(jo, apiTokenInfoKeyExpirationDate), + deserialize_field(jo, apiTokenInfoKeyDisplayExpirationDate), + deserialize_field>(jo, apiTokenInfoKeyLastUseDate), + deserialize_field(jo, apiTokenInfoKeyDisplayLastUseDate), + deserialize_field(jo, apiTokenInfoKeyUsedByCurrentRequest) + }; + } + + static QJsonValue serialize(const ApiTokenInfoDto &value) { + QJsonObject jo; + serialize_field(jo, apiTokenInfoKeyId, value.id); + serialize_field(jo, apiTokenInfoKeyUrl, value.url); + serialize_field(jo, apiTokenInfoKeyIsValid, value.isValid); + serialize_field(jo, apiTokenInfoKeyType, value.type); + serialize_field(jo, apiTokenInfoKeyDescription, value.description); + serialize_field(jo, apiTokenInfoKeyToken, value.token); + serialize_field(jo, apiTokenInfoKeyCreationDate, value.creationDate); + serialize_field(jo, apiTokenInfoKeyDisplayCreationDate, value.displayCreationDate); + serialize_field(jo, apiTokenInfoKeyExpirationDate, value.expirationDate); + serialize_field(jo, apiTokenInfoKeyDisplayExpirationDate, value.displayExpirationDate); + serialize_field(jo, apiTokenInfoKeyLastUseDate, value.lastUseDate); + serialize_field(jo, apiTokenInfoKeyDisplayLastUseDate, value.displayLastUseDate); + serialize_field(jo, apiTokenInfoKeyUsedByCurrentRequest, value.usedByCurrentRequest); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + ApiTokenInfoDto ApiTokenInfoDto::deserialize(const QByteArray &json) + { + return deserialize_bytes(json); + } + + ApiTokenInfoDto::ApiTokenInfoDto( + QString id, + QString url, + bool isValid, + QString type, + QString description, + std::optional token, + QString creationDate, + QString displayCreationDate, + QString expirationDate, + QString displayExpirationDate, + std::optional lastUseDate, + QString displayLastUseDate, + bool usedByCurrentRequest + ) : + id(std::move(id)), + url(std::move(url)), + isValid(std::move(isValid)), + type(std::move(type)), + description(std::move(description)), + token(std::move(token)), + creationDate(std::move(creationDate)), + displayCreationDate(std::move(displayCreationDate)), + expirationDate(std::move(expirationDate)), + displayExpirationDate(std::move(displayExpirationDate)), + lastUseDate(std::move(lastUseDate)), + displayLastUseDate(std::move(displayLastUseDate)), + usedByCurrentRequest(std::move(usedByCurrentRequest)) + { } + + ApiTokenInfoDto::ApiTokenInfoDto( + QString id, + QString url, + bool isValid, + ApiTokenType type, + QString description, + std::optional token, + QString creationDate, + QString displayCreationDate, + QString expirationDate, + QString displayExpirationDate, + std::optional lastUseDate, + QString displayLastUseDate, + bool usedByCurrentRequest + ) : ApiTokenInfoDto( + std::move(id), + std::move(url), + std::move(isValid), + ApiTokenTypeMeta::enumToStr(type), + std::move(description), + std::move(token), + std::move(creationDate), + std::move(displayCreationDate), + std::move(expirationDate), + std::move(displayExpirationDate), + std::move(lastUseDate), + std::move(displayLastUseDate), + std::move(usedByCurrentRequest)) + { } + + // throws std::range_error + ApiTokenType ApiTokenInfoDto::getTypeEnum() const + { + return ApiTokenTypeMeta::strToEnum(type); + } + + void ApiTokenInfoDto::setTypeEnum(ApiTokenType newValue) + { + type = ApiTokenTypeMeta::enumToStr(newValue); + } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray ApiTokenInfoDto::serialize() const + { + return serialize_bytes(*this); + } + + // ColumnInfoDto + + static const QLatin1String columnInfoKeyKey{"key"}; + static const QLatin1String columnInfoKeyHeader{"header"}; + static const QLatin1String columnInfoKeyCanSort{"canSort"}; + static const QLatin1String columnInfoKeyCanFilter{"canFilter"}; + static const QLatin1String columnInfoKeyAlignment{"alignment"}; + static const QLatin1String columnInfoKeyType{"type"}; + static const QLatin1String columnInfoKeyTypeOptions{"typeOptions"}; + static const QLatin1String columnInfoKeyWidth{"width"}; + static const QLatin1String columnInfoKeyShowByDefault{"showByDefault"}; + static const QLatin1String columnInfoKeyLinkKey{"linkKey"}; + + template<> + class de_serializer final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static ColumnInfoDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject(json); + return { + deserialize_field(jo, columnInfoKeyKey), + deserialize_field>(jo, columnInfoKeyHeader), + deserialize_field(jo, columnInfoKeyCanSort), + deserialize_field(jo, columnInfoKeyCanFilter), + deserialize_field(jo, columnInfoKeyAlignment), + deserialize_field(jo, columnInfoKeyType), + deserialize_field>>(jo, columnInfoKeyTypeOptions), + deserialize_field(jo, columnInfoKeyWidth), + deserialize_field(jo, columnInfoKeyShowByDefault), + deserialize_field>(jo, columnInfoKeyLinkKey) + }; + } + + static QJsonValue serialize(const ColumnInfoDto &value) { + QJsonObject jo; + serialize_field(jo, columnInfoKeyKey, value.key); + serialize_field(jo, columnInfoKeyHeader, value.header); + serialize_field(jo, columnInfoKeyCanSort, value.canSort); + serialize_field(jo, columnInfoKeyCanFilter, value.canFilter); + serialize_field(jo, columnInfoKeyAlignment, value.alignment); + serialize_field(jo, columnInfoKeyType, value.type); + serialize_field(jo, columnInfoKeyTypeOptions, value.typeOptions); + serialize_field(jo, columnInfoKeyWidth, value.width); + serialize_field(jo, columnInfoKeyShowByDefault, value.showByDefault); + serialize_field(jo, columnInfoKeyLinkKey, value.linkKey); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + ColumnInfoDto ColumnInfoDto::deserialize(const QByteArray &json) + { + return deserialize_bytes(json); + } + + ColumnInfoDto::ColumnInfoDto( + QString key, + std::optional header, + bool canSort, + bool canFilter, + QString alignment, + QString type, + std::optional> typeOptions, + qint32 width, + bool showByDefault, + std::optional linkKey + ) : + key(std::move(key)), + header(std::move(header)), + canSort(std::move(canSort)), + canFilter(std::move(canFilter)), + alignment(std::move(alignment)), + type(std::move(type)), + typeOptions(std::move(typeOptions)), + width(std::move(width)), + showByDefault(std::move(showByDefault)), + linkKey(std::move(linkKey)) + { } + + ColumnInfoDto::ColumnInfoDto( + QString key, + std::optional header, + bool canSort, + bool canFilter, + TableCellAlignment alignment, + QString type, + std::optional> typeOptions, + qint32 width, + bool showByDefault, + std::optional linkKey + ) : ColumnInfoDto( + std::move(key), + std::move(header), + std::move(canSort), + std::move(canFilter), + TableCellAlignmentMeta::enumToStr(alignment), + std::move(type), + std::move(typeOptions), + std::move(width), + std::move(showByDefault), + std::move(linkKey)) + { } + + // throws std::range_error + TableCellAlignment ColumnInfoDto::getAlignmentEnum() const + { + return TableCellAlignmentMeta::strToEnum(alignment); + } + + void ColumnInfoDto::setAlignmentEnum(TableCellAlignment newValue) + { + alignment = TableCellAlignmentMeta::enumToStr(newValue); + } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray ColumnInfoDto::serialize() const + { + return serialize_bytes(*this); + } + + // DashboardInfoDto + + static const QLatin1String dashboardInfoKeyMainUrl{"mainUrl"}; + static const QLatin1String dashboardInfoKeyDashboardVersion{"dashboardVersion"}; + static const QLatin1String dashboardInfoKeyDashboardVersionNumber{"dashboardVersionNumber"}; + static const QLatin1String dashboardInfoKeyDashboardBuildDate{"dashboardBuildDate"}; + static const QLatin1String dashboardInfoKeyUsername{"username"}; + static const QLatin1String dashboardInfoKeyCsrfTokenHeader{"csrfTokenHeader"}; + static const QLatin1String dashboardInfoKeyCsrfToken{"csrfToken"}; + static const QLatin1String dashboardInfoKeyCheckCredentialsUrl{"checkCredentialsUrl"}; + static const QLatin1String dashboardInfoKeyNamedFiltersUrl{"namedFiltersUrl"}; + static const QLatin1String dashboardInfoKeyProjects{"projects"}; + static const QLatin1String dashboardInfoKeyUserApiTokenUrl{"userApiTokenUrl"}; + static const QLatin1String dashboardInfoKeyUserNamedFiltersUrl{"userNamedFiltersUrl"}; + static const QLatin1String dashboardInfoKeySupportAddress{"supportAddress"}; + static const QLatin1String dashboardInfoKeyIssueFilterHelp{"issueFilterHelp"}; + + template<> + class de_serializer final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static DashboardInfoDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject(json); + return { + deserialize_field>(jo, dashboardInfoKeyMainUrl), + deserialize_field(jo, dashboardInfoKeyDashboardVersion), + deserialize_field>(jo, dashboardInfoKeyDashboardVersionNumber), + deserialize_field(jo, dashboardInfoKeyDashboardBuildDate), + deserialize_field>(jo, dashboardInfoKeyUsername), + deserialize_field(jo, dashboardInfoKeyCsrfTokenHeader), + deserialize_field(jo, dashboardInfoKeyCsrfToken), + deserialize_field>(jo, dashboardInfoKeyCheckCredentialsUrl), + deserialize_field>(jo, dashboardInfoKeyNamedFiltersUrl), + deserialize_field>>(jo, dashboardInfoKeyProjects), + deserialize_field>(jo, dashboardInfoKeyUserApiTokenUrl), + deserialize_field>(jo, dashboardInfoKeyUserNamedFiltersUrl), + deserialize_field>(jo, dashboardInfoKeySupportAddress), + deserialize_field>(jo, dashboardInfoKeyIssueFilterHelp) + }; + } + + static QJsonValue serialize(const DashboardInfoDto &value) { + QJsonObject jo; + serialize_field(jo, dashboardInfoKeyMainUrl, value.mainUrl); + serialize_field(jo, dashboardInfoKeyDashboardVersion, value.dashboardVersion); + serialize_field(jo, dashboardInfoKeyDashboardVersionNumber, value.dashboardVersionNumber); + serialize_field(jo, dashboardInfoKeyDashboardBuildDate, value.dashboardBuildDate); + serialize_field(jo, dashboardInfoKeyUsername, value.username); + serialize_field(jo, dashboardInfoKeyCsrfTokenHeader, value.csrfTokenHeader); + serialize_field(jo, dashboardInfoKeyCsrfToken, value.csrfToken); + serialize_field(jo, dashboardInfoKeyCheckCredentialsUrl, value.checkCredentialsUrl); + serialize_field(jo, dashboardInfoKeyNamedFiltersUrl, value.namedFiltersUrl); + serialize_field(jo, dashboardInfoKeyProjects, value.projects); + serialize_field(jo, dashboardInfoKeyUserApiTokenUrl, value.userApiTokenUrl); + serialize_field(jo, dashboardInfoKeyUserNamedFiltersUrl, value.userNamedFiltersUrl); + serialize_field(jo, dashboardInfoKeySupportAddress, value.supportAddress); + serialize_field(jo, dashboardInfoKeyIssueFilterHelp, value.issueFilterHelp); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + DashboardInfoDto DashboardInfoDto::deserialize(const QByteArray &json) + { + return deserialize_bytes(json); + } + + DashboardInfoDto::DashboardInfoDto( + std::optional mainUrl, + QString dashboardVersion, + std::optional dashboardVersionNumber, + QString dashboardBuildDate, + std::optional username, + QString csrfTokenHeader, + QString csrfToken, + std::optional checkCredentialsUrl, + std::optional namedFiltersUrl, + std::optional> projects, + std::optional userApiTokenUrl, + std::optional userNamedFiltersUrl, + std::optional supportAddress, + std::optional issueFilterHelp + ) : + mainUrl(std::move(mainUrl)), + dashboardVersion(std::move(dashboardVersion)), + dashboardVersionNumber(std::move(dashboardVersionNumber)), + dashboardBuildDate(std::move(dashboardBuildDate)), + username(std::move(username)), + csrfTokenHeader(std::move(csrfTokenHeader)), + csrfToken(std::move(csrfToken)), + checkCredentialsUrl(std::move(checkCredentialsUrl)), + namedFiltersUrl(std::move(namedFiltersUrl)), + projects(std::move(projects)), + userApiTokenUrl(std::move(userApiTokenUrl)), + userNamedFiltersUrl(std::move(userNamedFiltersUrl)), + supportAddress(std::move(supportAddress)), + issueFilterHelp(std::move(issueFilterHelp)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray DashboardInfoDto::serialize() const + { + return serialize_bytes(*this); + } + + // IssueCommentListDto + + static const QLatin1String issueCommentListKeyComments{"comments"}; + + template<> + class de_serializer final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static IssueCommentListDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject(json); + return { + deserialize_field>(jo, issueCommentListKeyComments) + }; + } + + static QJsonValue serialize(const IssueCommentListDto &value) { + QJsonObject jo; + serialize_field(jo, issueCommentListKeyComments, value.comments); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + IssueCommentListDto IssueCommentListDto::deserialize(const QByteArray &json) + { + return deserialize_bytes(json); + } + + IssueCommentListDto::IssueCommentListDto( + std::vector comments + ) : + comments(std::move(comments)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray IssueCommentListDto::serialize() const + { + return serialize_bytes(*this); + } + + // IssueKindInfoDto + + static const QLatin1String issueKindInfoKeyPrefix{"prefix"}; + static const QLatin1String issueKindInfoKeyNiceSingularName{"niceSingularName"}; + static const QLatin1String issueKindInfoKeyNicePluralName{"nicePluralName"}; + + template<> + class de_serializer final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static IssueKindInfoDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject(json); + return { + deserialize_field(jo, issueKindInfoKeyPrefix), + deserialize_field(jo, issueKindInfoKeyNiceSingularName), + deserialize_field(jo, issueKindInfoKeyNicePluralName) + }; + } + + static QJsonValue serialize(const IssueKindInfoDto &value) { + QJsonObject jo; + serialize_field(jo, issueKindInfoKeyPrefix, value.prefix); + serialize_field(jo, issueKindInfoKeyNiceSingularName, value.niceSingularName); + serialize_field(jo, issueKindInfoKeyNicePluralName, value.nicePluralName); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + IssueKindInfoDto IssueKindInfoDto::deserialize(const QByteArray &json) + { + return deserialize_bytes(json); + } + + IssueKindInfoDto::IssueKindInfoDto( + QString prefix, + QString niceSingularName, + QString nicePluralName + ) : + prefix(std::move(prefix)), + niceSingularName(std::move(niceSingularName)), + nicePluralName(std::move(nicePluralName)) + { } + + IssueKindInfoDto::IssueKindInfoDto( + IssueKind prefix, + QString niceSingularName, + QString nicePluralName + ) : IssueKindInfoDto( + IssueKindMeta::enumToStr(prefix), + std::move(niceSingularName), + std::move(nicePluralName)) + { } + + // throws std::range_error + IssueKind IssueKindInfoDto::getPrefixEnum() const + { + return IssueKindMeta::strToEnum(prefix); + } + + void IssueKindInfoDto::setPrefixEnum(IssueKind newValue) + { + prefix = IssueKindMeta::enumToStr(newValue); + } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray IssueKindInfoDto::serialize() const + { + return serialize_bytes(*this); + } + + // IssueTagTypeListDto + + static const QLatin1String issueTagTypeListKeyTags{"tags"}; + + template<> + class de_serializer final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static IssueTagTypeListDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject(json); + return { + deserialize_field>(jo, issueTagTypeListKeyTags) + }; + } + + static QJsonValue serialize(const IssueTagTypeListDto &value) { + QJsonObject jo; + serialize_field(jo, issueTagTypeListKeyTags, value.tags); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + IssueTagTypeListDto IssueTagTypeListDto::deserialize(const QByteArray &json) + { + return deserialize_bytes(json); + } + + IssueTagTypeListDto::IssueTagTypeListDto( + std::vector tags + ) : + tags(std::move(tags)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray IssueTagTypeListDto::serialize() const + { + return serialize_bytes(*this); + } + + // LineMarkerDto + + static const QLatin1String lineMarkerKeyKind{"kind"}; + static const QLatin1String lineMarkerKeyId{"id"}; + static const QLatin1String lineMarkerKeyStartLine{"startLine"}; + static const QLatin1String lineMarkerKeyStartColumn{"startColumn"}; + static const QLatin1String lineMarkerKeyEndLine{"endLine"}; + static const QLatin1String lineMarkerKeyEndColumn{"endColumn"}; + static const QLatin1String lineMarkerKeyDescription{"description"}; + static const QLatin1String lineMarkerKeyIssueUrl{"issueUrl"}; + static const QLatin1String lineMarkerKeyIsNew{"isNew"}; + + template<> + class de_serializer final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static LineMarkerDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject(json); + return { + deserialize_field(jo, lineMarkerKeyKind), + deserialize_field>(jo, lineMarkerKeyId), + deserialize_field(jo, lineMarkerKeyStartLine), + deserialize_field(jo, lineMarkerKeyStartColumn), + deserialize_field(jo, lineMarkerKeyEndLine), + deserialize_field(jo, lineMarkerKeyEndColumn), + deserialize_field(jo, lineMarkerKeyDescription), + deserialize_field>(jo, lineMarkerKeyIssueUrl), + deserialize_field>(jo, lineMarkerKeyIsNew) + }; + } + + static QJsonValue serialize(const LineMarkerDto &value) { + QJsonObject jo; + serialize_field(jo, lineMarkerKeyKind, value.kind); + serialize_field(jo, lineMarkerKeyId, value.id); + serialize_field(jo, lineMarkerKeyStartLine, value.startLine); + serialize_field(jo, lineMarkerKeyStartColumn, value.startColumn); + serialize_field(jo, lineMarkerKeyEndLine, value.endLine); + serialize_field(jo, lineMarkerKeyEndColumn, value.endColumn); + serialize_field(jo, lineMarkerKeyDescription, value.description); + serialize_field(jo, lineMarkerKeyIssueUrl, value.issueUrl); + serialize_field(jo, lineMarkerKeyIsNew, value.isNew); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + LineMarkerDto LineMarkerDto::deserialize(const QByteArray &json) + { + return deserialize_bytes(json); + } + + LineMarkerDto::LineMarkerDto( + QString kind, + std::optional id, + qint32 startLine, + qint32 startColumn, + qint32 endLine, + qint32 endColumn, + QString description, + std::optional issueUrl, + std::optional isNew + ) : + kind(std::move(kind)), + id(std::move(id)), + startLine(std::move(startLine)), + startColumn(std::move(startColumn)), + endLine(std::move(endLine)), + endColumn(std::move(endColumn)), + description(std::move(description)), + issueUrl(std::move(issueUrl)), + isNew(std::move(isNew)) + { } + + LineMarkerDto::LineMarkerDto( + IssueKind kind, + std::optional id, + qint32 startLine, + qint32 startColumn, + qint32 endLine, + qint32 endColumn, + QString description, + std::optional issueUrl, + std::optional isNew + ) : LineMarkerDto( + IssueKindMeta::enumToStr(kind), + std::move(id), + std::move(startLine), + std::move(startColumn), + std::move(endLine), + std::move(endColumn), + std::move(description), + std::move(issueUrl), + std::move(isNew)) + { } + + // throws std::range_error + IssueKind LineMarkerDto::getKindEnum() const + { + return IssueKindMeta::strToEnum(kind); + } + + void LineMarkerDto::setKindEnum(IssueKind newValue) + { + kind = IssueKindMeta::enumToStr(newValue); + } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray LineMarkerDto::serialize() const + { + return serialize_bytes(*this); + } + + // RepositoryUpdateMessageDto + + static const QLatin1String repositoryUpdateMessageKeySeverity{"severity"}; + static const QLatin1String repositoryUpdateMessageKeyMessage{"message"}; + + template<> + class de_serializer final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static RepositoryUpdateMessageDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject(json); + return { + deserialize_field>(jo, repositoryUpdateMessageKeySeverity), + deserialize_field>(jo, repositoryUpdateMessageKeyMessage) + }; + } + + static QJsonValue serialize(const RepositoryUpdateMessageDto &value) { + QJsonObject jo; + serialize_field(jo, repositoryUpdateMessageKeySeverity, value.severity); + serialize_field(jo, repositoryUpdateMessageKeyMessage, value.message); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + RepositoryUpdateMessageDto RepositoryUpdateMessageDto::deserialize(const QByteArray &json) + { + return deserialize_bytes(json); + } + + RepositoryUpdateMessageDto::RepositoryUpdateMessageDto( + std::optional severity, + std::optional message + ) : + severity(std::move(severity)), + message(std::move(message)) + { } + + RepositoryUpdateMessageDto::RepositoryUpdateMessageDto( + std::optional severity, + std::optional message + ) : RepositoryUpdateMessageDto( + optionalTransform(severity, MessageSeverityMeta::enumToStr), + std::move(message)) + { } + + // throws std::range_error + std::optional RepositoryUpdateMessageDto::getSeverityEnum() const + { + return optionalTransform(severity, MessageSeverityMeta::strToEnum); + } + + void RepositoryUpdateMessageDto::setSeverityEnum(std::optional newValue) + { + severity = optionalTransform(newValue, MessageSeverityMeta::enumToStr); + } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray RepositoryUpdateMessageDto::serialize() const + { + return serialize_bytes(*this); + } + + // RuleListDto + + static const QLatin1String ruleListKeyRules{"rules"}; + + template<> + class de_serializer final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static RuleListDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject(json); + return { + deserialize_field>(jo, ruleListKeyRules) + }; + } + + static QJsonValue serialize(const RuleListDto &value) { + QJsonObject jo; + serialize_field(jo, ruleListKeyRules, value.rules); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + RuleListDto RuleListDto::deserialize(const QByteArray &json) + { + return deserialize_bytes(json); + } + + RuleListDto::RuleListDto( + std::vector rules + ) : + rules(std::move(rules)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray RuleListDto::serialize() const + { + return serialize_bytes(*this); + } + + // SortInfoDto + + static const QLatin1String sortInfoKeyKey{"key"}; + static const QLatin1String sortInfoKeyDirection{"direction"}; + + template<> + class de_serializer final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static SortInfoDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject(json); + return { + deserialize_field(jo, sortInfoKeyKey), + deserialize_field(jo, sortInfoKeyDirection) + }; + } + + static QJsonValue serialize(const SortInfoDto &value) { + QJsonObject jo; + serialize_field(jo, sortInfoKeyKey, value.key); + serialize_field(jo, sortInfoKeyDirection, value.direction); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + SortInfoDto SortInfoDto::deserialize(const QByteArray &json) + { + return deserialize_bytes(json); + } + + SortInfoDto::SortInfoDto( + QString key, + QString direction + ) : + key(std::move(key)), + direction(std::move(direction)) + { } + + SortInfoDto::SortInfoDto( + QString key, + SortDirection direction + ) : SortInfoDto( + std::move(key), + SortDirectionMeta::enumToStr(direction)) + { } + + // throws std::range_error + SortDirection SortInfoDto::getDirectionEnum() const + { + return SortDirectionMeta::strToEnum(direction); + } + + void SortInfoDto::setDirectionEnum(SortDirection newValue) + { + direction = SortDirectionMeta::enumToStr(newValue); + } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray SortInfoDto::serialize() const + { + return serialize_bytes(*this); + } + + // UserRefDto + + static const QLatin1String userRefKeyName{"name"}; + static const QLatin1String userRefKeyDisplayName{"displayName"}; + static const QLatin1String userRefKeyType{"type"}; + static const QLatin1String userRefKeyIsPublic{"isPublic"}; + + template<> + class de_serializer final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static UserRefDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject(json); + return { + deserialize_field(jo, userRefKeyName), + deserialize_field(jo, userRefKeyDisplayName), + deserialize_field>(jo, userRefKeyType), + deserialize_field>(jo, userRefKeyIsPublic) + }; + } + + static QJsonValue serialize(const UserRefDto &value) { + QJsonObject jo; + serialize_field(jo, userRefKeyName, value.name); + serialize_field(jo, userRefKeyDisplayName, value.displayName); + serialize_field(jo, userRefKeyType, value.type); + serialize_field(jo, userRefKeyIsPublic, value.isPublic); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + UserRefDto UserRefDto::deserialize(const QByteArray &json) + { + return deserialize_bytes(json); + } + + UserRefDto::UserRefDto( + QString name, + QString displayName, + std::optional type, + std::optional isPublic + ) : + name(std::move(name)), + displayName(std::move(displayName)), + type(std::move(type)), + isPublic(std::move(isPublic)) + { } + + UserRefDto::UserRefDto( + QString name, + QString displayName, + std::optional type, + std::optional isPublic + ) : UserRefDto( + std::move(name), + std::move(displayName), + optionalTransform(type, UserRefTypeMeta::enumToStr), + std::move(isPublic)) + { } + + // throws std::range_error + std::optional UserRefDto::getTypeEnum() const + { + return optionalTransform(type, UserRefTypeMeta::strToEnum); + } + + void UserRefDto::setTypeEnum(std::optional newValue) + { + type = optionalTransform(newValue, UserRefTypeMeta::enumToStr); + } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray UserRefDto::serialize() const + { + return serialize_bytes(*this); + } + + // AnalyzedFileListDto + + static const QLatin1String analyzedFileListKeyVersion{"version"}; + static const QLatin1String analyzedFileListKeyRows{"rows"}; + + template<> + class de_serializer final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static AnalyzedFileListDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject(json); + return { + deserialize_field(jo, analyzedFileListKeyVersion), + deserialize_field>(jo, analyzedFileListKeyRows) + }; + } + + static QJsonValue serialize(const AnalyzedFileListDto &value) { + QJsonObject jo; + serialize_field(jo, analyzedFileListKeyVersion, value.version); + serialize_field(jo, analyzedFileListKeyRows, value.rows); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + AnalyzedFileListDto AnalyzedFileListDto::deserialize(const QByteArray &json) + { + return deserialize_bytes(json); + } + + AnalyzedFileListDto::AnalyzedFileListDto( + AnalysisVersionDto version, + std::vector rows + ) : + version(std::move(version)), + rows(std::move(rows)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray AnalyzedFileListDto::serialize() const + { + return serialize_bytes(*this); + } + + // EntityListDto + + static const QLatin1String entityListKeyVersion{"version"}; + static const QLatin1String entityListKeyEntities{"entities"}; + + template<> + class de_serializer final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static EntityListDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject(json); + return { + deserialize_field>(jo, entityListKeyVersion), + deserialize_field>(jo, entityListKeyEntities) + }; + } + + static QJsonValue serialize(const EntityListDto &value) { + QJsonObject jo; + serialize_field(jo, entityListKeyVersion, value.version); + serialize_field(jo, entityListKeyEntities, value.entities); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + EntityListDto EntityListDto::deserialize(const QByteArray &json) + { + return deserialize_bytes(json); + } + + EntityListDto::EntityListDto( + std::optional version, + std::vector entities + ) : + version(std::move(version)), + entities(std::move(entities)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray EntityListDto::serialize() const + { + return serialize_bytes(*this); + } + + // FileViewDto + + static const QLatin1String fileViewKeyFileName{"fileName"}; + static const QLatin1String fileViewKeyVersion{"version"}; + static const QLatin1String fileViewKeySourceCodeUrl{"sourceCodeUrl"}; + static const QLatin1String fileViewKeyLineMarkers{"lineMarkers"}; + + template<> + class de_serializer final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static FileViewDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject(json); + return { + deserialize_field(jo, fileViewKeyFileName), + deserialize_field>(jo, fileViewKeyVersion), + deserialize_field>(jo, fileViewKeySourceCodeUrl), + deserialize_field>(jo, fileViewKeyLineMarkers) + }; + } + + static QJsonValue serialize(const FileViewDto &value) { + QJsonObject jo; + serialize_field(jo, fileViewKeyFileName, value.fileName); + serialize_field(jo, fileViewKeyVersion, value.version); + serialize_field(jo, fileViewKeySourceCodeUrl, value.sourceCodeUrl); + serialize_field(jo, fileViewKeyLineMarkers, value.lineMarkers); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + FileViewDto FileViewDto::deserialize(const QByteArray &json) + { + return deserialize_bytes(json); + } + + FileViewDto::FileViewDto( + QString fileName, + std::optional version, + std::optional sourceCodeUrl, + std::vector lineMarkers + ) : + fileName(std::move(fileName)), + version(std::move(version)), + sourceCodeUrl(std::move(sourceCodeUrl)), + lineMarkers(std::move(lineMarkers)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray FileViewDto::serialize() const + { + return serialize_bytes(*this); + } + + // IssueDto + + static const QLatin1String issueKeyKind{"kind"}; + static const QLatin1String issueKeyId{"id"}; + static const QLatin1String issueKeyParentProject{"parentProject"}; + static const QLatin1String issueKeySourceLocations{"sourceLocations"}; + static const QLatin1String issueKeyIssueKind{"issueKind"}; + static const QLatin1String issueKeyIsHidden{"isHidden"}; + static const QLatin1String issueKeyIssueViewUrl{"issueViewUrl"}; + + template<> + class de_serializer final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static IssueDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject(json); + return { + deserialize_field(jo, issueKeyKind), + deserialize_field(jo, issueKeyId), + deserialize_field(jo, issueKeyParentProject), + deserialize_field>(jo, issueKeySourceLocations), + deserialize_field(jo, issueKeyIssueKind), + deserialize_field(jo, issueKeyIsHidden), + deserialize_field>(jo, issueKeyIssueViewUrl) + }; + } + + static QJsonValue serialize(const IssueDto &value) { + QJsonObject jo; + serialize_field(jo, issueKeyKind, value.kind); + serialize_field(jo, issueKeyId, value.id); + serialize_field(jo, issueKeyParentProject, value.parentProject); + serialize_field(jo, issueKeySourceLocations, value.sourceLocations); + serialize_field(jo, issueKeyIssueKind, value.issueKind); + serialize_field(jo, issueKeyIsHidden, value.isHidden); + serialize_field(jo, issueKeyIssueViewUrl, value.issueViewUrl); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + IssueDto IssueDto::deserialize(const QByteArray &json) + { + return deserialize_bytes(json); + } + + IssueDto::IssueDto( + QString kind, + qint64 id, + ProjectReferenceDto parentProject, + std::vector sourceLocations, + IssueKindInfoDto issueKind, + bool isHidden, + std::optional issueViewUrl + ) : + kind(std::move(kind)), + id(std::move(id)), + parentProject(std::move(parentProject)), + sourceLocations(std::move(sourceLocations)), + issueKind(std::move(issueKind)), + isHidden(std::move(isHidden)), + issueViewUrl(std::move(issueViewUrl)) + { } + + IssueDto::IssueDto( + IssueKind kind, + qint64 id, + ProjectReferenceDto parentProject, + std::vector sourceLocations, + IssueKindInfoDto issueKind, + bool isHidden, + std::optional issueViewUrl + ) : IssueDto( + IssueKindMeta::enumToStr(kind), + std::move(id), + std::move(parentProject), + std::move(sourceLocations), + std::move(issueKind), + std::move(isHidden), + std::move(issueViewUrl)) + { } + + // throws std::range_error + IssueKind IssueDto::getKindEnum() const + { + return IssueKindMeta::strToEnum(kind); + } + + void IssueDto::setKindEnum(IssueKind newValue) + { + kind = IssueKindMeta::enumToStr(newValue); + } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray IssueDto::serialize() const + { + return serialize_bytes(*this); + } + + // IssueTableDto + + static const QLatin1String issueTableKeyStartVersion{"startVersion"}; + static const QLatin1String issueTableKeyEndVersion{"endVersion"}; + static const QLatin1String issueTableKeyTableViewUrl{"tableViewUrl"}; + static const QLatin1String issueTableKeyColumns{"columns"}; + static const QLatin1String issueTableKeyRows{"rows"}; + static const QLatin1String issueTableKeyTotalRowCount{"totalRowCount"}; + static const QLatin1String issueTableKeyTotalAddedCount{"totalAddedCount"}; + static const QLatin1String issueTableKeyTotalRemovedCount{"totalRemovedCount"}; + + template<> + class de_serializer final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static IssueTableDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject(json); + return { + deserialize_field>(jo, issueTableKeyStartVersion), + deserialize_field(jo, issueTableKeyEndVersion), + deserialize_field>(jo, issueTableKeyTableViewUrl), + deserialize_field>>(jo, issueTableKeyColumns), + deserialize_field>>(jo, issueTableKeyRows), + deserialize_field>(jo, issueTableKeyTotalRowCount), + deserialize_field>(jo, issueTableKeyTotalAddedCount), + deserialize_field>(jo, issueTableKeyTotalRemovedCount) + }; + } + + static QJsonValue serialize(const IssueTableDto &value) { + QJsonObject jo; + serialize_field(jo, issueTableKeyStartVersion, value.startVersion); + serialize_field(jo, issueTableKeyEndVersion, value.endVersion); + serialize_field(jo, issueTableKeyTableViewUrl, value.tableViewUrl); + serialize_field(jo, issueTableKeyColumns, value.columns); + serialize_field(jo, issueTableKeyRows, value.rows); + serialize_field(jo, issueTableKeyTotalRowCount, value.totalRowCount); + serialize_field(jo, issueTableKeyTotalAddedCount, value.totalAddedCount); + serialize_field(jo, issueTableKeyTotalRemovedCount, value.totalRemovedCount); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + IssueTableDto IssueTableDto::deserialize(const QByteArray &json) + { + return deserialize_bytes(json); + } + + IssueTableDto::IssueTableDto( + std::optional startVersion, + AnalysisVersionDto endVersion, + std::optional tableViewUrl, + std::optional> columns, + std::vector> rows, + std::optional totalRowCount, + std::optional totalAddedCount, + std::optional totalRemovedCount + ) : + startVersion(std::move(startVersion)), + endVersion(std::move(endVersion)), + tableViewUrl(std::move(tableViewUrl)), + columns(std::move(columns)), + rows(std::move(rows)), + totalRowCount(std::move(totalRowCount)), + totalAddedCount(std::move(totalAddedCount)), + totalRemovedCount(std::move(totalRemovedCount)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray IssueTableDto::serialize() const + { + return serialize_bytes(*this); + } + + // MetricListDto + + static const QLatin1String metricListKeyVersion{"version"}; + static const QLatin1String metricListKeyMetrics{"metrics"}; + + template<> + class de_serializer final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static MetricListDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject(json); + return { + deserialize_field>(jo, metricListKeyVersion), + deserialize_field>(jo, metricListKeyMetrics) + }; + } + + static QJsonValue serialize(const MetricListDto &value) { + QJsonObject jo; + serialize_field(jo, metricListKeyVersion, value.version); + serialize_field(jo, metricListKeyMetrics, value.metrics); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + MetricListDto MetricListDto::deserialize(const QByteArray &json) + { + return deserialize_bytes(json); + } + + MetricListDto::MetricListDto( + std::optional version, + std::vector metrics + ) : + version(std::move(version)), + metrics(std::move(metrics)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray MetricListDto::serialize() const + { + return serialize_bytes(*this); + } + + // MetricValueRangeDto + + static const QLatin1String metricValueRangeKeyStartVersion{"startVersion"}; + static const QLatin1String metricValueRangeKeyEndVersion{"endVersion"}; + static const QLatin1String metricValueRangeKeyEntity{"entity"}; + static const QLatin1String metricValueRangeKeyMetric{"metric"}; + static const QLatin1String metricValueRangeKeyValues{"values"}; + + template<> + class de_serializer final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static MetricValueRangeDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject(json); + return { + deserialize_field(jo, metricValueRangeKeyStartVersion), + deserialize_field(jo, metricValueRangeKeyEndVersion), + deserialize_field(jo, metricValueRangeKeyEntity), + deserialize_field(jo, metricValueRangeKeyMetric), + deserialize_field>>(jo, metricValueRangeKeyValues) + }; + } + + static QJsonValue serialize(const MetricValueRangeDto &value) { + QJsonObject jo; + serialize_field(jo, metricValueRangeKeyStartVersion, value.startVersion); + serialize_field(jo, metricValueRangeKeyEndVersion, value.endVersion); + serialize_field(jo, metricValueRangeKeyEntity, value.entity); + serialize_field(jo, metricValueRangeKeyMetric, value.metric); + serialize_field(jo, metricValueRangeKeyValues, value.values); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + MetricValueRangeDto MetricValueRangeDto::deserialize(const QByteArray &json) + { + return deserialize_bytes(json); + } + + MetricValueRangeDto::MetricValueRangeDto( + AnalysisVersionDto startVersion, + AnalysisVersionDto endVersion, + QString entity, + QString metric, + std::vector> values + ) : + startVersion(std::move(startVersion)), + endVersion(std::move(endVersion)), + entity(std::move(entity)), + metric(std::move(metric)), + values(std::move(values)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray MetricValueRangeDto::serialize() const + { + return serialize_bytes(*this); + } + + // MetricValueTableDto + + static const QLatin1String metricValueTableKeyColumns{"columns"}; + static const QLatin1String metricValueTableKeyRows{"rows"}; + + template<> + class de_serializer final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static MetricValueTableDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject(json); + return { + deserialize_field>(jo, metricValueTableKeyColumns), + deserialize_field>(jo, metricValueTableKeyRows) + }; + } + + static QJsonValue serialize(const MetricValueTableDto &value) { + QJsonObject jo; + serialize_field(jo, metricValueTableKeyColumns, value.columns); + serialize_field(jo, metricValueTableKeyRows, value.rows); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + MetricValueTableDto MetricValueTableDto::deserialize(const QByteArray &json) + { + return deserialize_bytes(json); + } + + MetricValueTableDto::MetricValueTableDto( + std::vector columns, + std::vector rows + ) : + columns(std::move(columns)), + rows(std::move(rows)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray MetricValueTableDto::serialize() const + { + return serialize_bytes(*this); + } + + // NamedFilterCreateDto + + static const QLatin1String namedFilterCreateKeyDisplayName{"displayName"}; + static const QLatin1String namedFilterCreateKeyKind{"kind"}; + static const QLatin1String namedFilterCreateKeyFilters{"filters"}; + static const QLatin1String namedFilterCreateKeySorters{"sorters"}; + static const QLatin1String namedFilterCreateKeyVisibility{"visibility"}; + + template<> + class de_serializer final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static NamedFilterCreateDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject(json); + return { + deserialize_field(jo, namedFilterCreateKeyDisplayName), + deserialize_field(jo, namedFilterCreateKeyKind), + deserialize_field>(jo, namedFilterCreateKeyFilters), + deserialize_field>(jo, namedFilterCreateKeySorters), + deserialize_field>(jo, namedFilterCreateKeyVisibility) + }; + } + + static QJsonValue serialize(const NamedFilterCreateDto &value) { + QJsonObject jo; + serialize_field(jo, namedFilterCreateKeyDisplayName, value.displayName); + serialize_field(jo, namedFilterCreateKeyKind, value.kind); + serialize_field(jo, namedFilterCreateKeyFilters, value.filters); + serialize_field(jo, namedFilterCreateKeySorters, value.sorters); + serialize_field(jo, namedFilterCreateKeyVisibility, value.visibility); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + NamedFilterCreateDto NamedFilterCreateDto::deserialize(const QByteArray &json) + { + return deserialize_bytes(json); + } + + NamedFilterCreateDto::NamedFilterCreateDto( + QString displayName, + QString kind, + std::map filters, + std::vector sorters, + std::optional visibility + ) : + displayName(std::move(displayName)), + kind(std::move(kind)), + filters(std::move(filters)), + sorters(std::move(sorters)), + visibility(std::move(visibility)) + { } + + NamedFilterCreateDto::NamedFilterCreateDto( + QString displayName, + IssueKindForNamedFilterCreation kind, + std::map filters, + std::vector sorters, + std::optional visibility + ) : NamedFilterCreateDto( + std::move(displayName), + IssueKindForNamedFilterCreationMeta::enumToStr(kind), + std::move(filters), + std::move(sorters), + std::move(visibility)) + { } + + // throws std::range_error + IssueKindForNamedFilterCreation NamedFilterCreateDto::getKindEnum() const + { + return IssueKindForNamedFilterCreationMeta::strToEnum(kind); + } + + void NamedFilterCreateDto::setKindEnum(IssueKindForNamedFilterCreation newValue) + { + kind = IssueKindForNamedFilterCreationMeta::enumToStr(newValue); + } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray NamedFilterCreateDto::serialize() const + { + return serialize_bytes(*this); + } + + // NamedFilterInfoDto + + static const QLatin1String namedFilterInfoKeyKey{"key"}; + static const QLatin1String namedFilterInfoKeyDisplayName{"displayName"}; + static const QLatin1String namedFilterInfoKeyUrl{"url"}; + static const QLatin1String namedFilterInfoKeyIsPredefined{"isPredefined"}; + static const QLatin1String namedFilterInfoKeyType{"type"}; + static const QLatin1String namedFilterInfoKeyCanWrite{"canWrite"}; + static const QLatin1String namedFilterInfoKeyFilters{"filters"}; + static const QLatin1String namedFilterInfoKeySorters{"sorters"}; + static const QLatin1String namedFilterInfoKeySupportsAllIssueKinds{"supportsAllIssueKinds"}; + static const QLatin1String namedFilterInfoKeyIssueKindRestrictions{"issueKindRestrictions"}; + static const QLatin1String namedFilterInfoKeyVisibility{"visibility"}; + + template<> + class de_serializer final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static NamedFilterInfoDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject(json); + return { + deserialize_field(jo, namedFilterInfoKeyKey), + deserialize_field(jo, namedFilterInfoKeyDisplayName), + deserialize_field>(jo, namedFilterInfoKeyUrl), + deserialize_field(jo, namedFilterInfoKeyIsPredefined), + deserialize_field>(jo, namedFilterInfoKeyType), + deserialize_field(jo, namedFilterInfoKeyCanWrite), + deserialize_field>(jo, namedFilterInfoKeyFilters), + deserialize_field>>(jo, namedFilterInfoKeySorters), + deserialize_field(jo, namedFilterInfoKeySupportsAllIssueKinds), + deserialize_field>>(jo, namedFilterInfoKeyIssueKindRestrictions), + deserialize_field>(jo, namedFilterInfoKeyVisibility) + }; + } + + static QJsonValue serialize(const NamedFilterInfoDto &value) { + QJsonObject jo; + serialize_field(jo, namedFilterInfoKeyKey, value.key); + serialize_field(jo, namedFilterInfoKeyDisplayName, value.displayName); + serialize_field(jo, namedFilterInfoKeyUrl, value.url); + serialize_field(jo, namedFilterInfoKeyIsPredefined, value.isPredefined); + serialize_field(jo, namedFilterInfoKeyType, value.type); + serialize_field(jo, namedFilterInfoKeyCanWrite, value.canWrite); + serialize_field(jo, namedFilterInfoKeyFilters, value.filters); + serialize_field(jo, namedFilterInfoKeySorters, value.sorters); + serialize_field(jo, namedFilterInfoKeySupportsAllIssueKinds, value.supportsAllIssueKinds); + serialize_field(jo, namedFilterInfoKeyIssueKindRestrictions, value.issueKindRestrictions); + serialize_field(jo, namedFilterInfoKeyVisibility, value.visibility); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + NamedFilterInfoDto NamedFilterInfoDto::deserialize(const QByteArray &json) + { + return deserialize_bytes(json); + } + + NamedFilterInfoDto::NamedFilterInfoDto( + QString key, + QString displayName, + std::optional url, + bool isPredefined, + std::optional type, + bool canWrite, + std::map filters, + std::optional> sorters, + bool supportsAllIssueKinds, + std::optional> issueKindRestrictions, + std::optional visibility + ) : + key(std::move(key)), + displayName(std::move(displayName)), + url(std::move(url)), + isPredefined(std::move(isPredefined)), + type(std::move(type)), + canWrite(std::move(canWrite)), + filters(std::move(filters)), + sorters(std::move(sorters)), + supportsAllIssueKinds(std::move(supportsAllIssueKinds)), + issueKindRestrictions(std::move(issueKindRestrictions)), + visibility(std::move(visibility)) + { } + + NamedFilterInfoDto::NamedFilterInfoDto( + QString key, + QString displayName, + std::optional url, + bool isPredefined, + std::optional type, + bool canWrite, + std::map filters, + std::optional> sorters, + bool supportsAllIssueKinds, + std::optional> issueKindRestrictions, + std::optional visibility + ) : NamedFilterInfoDto( + std::move(key), + std::move(displayName), + std::move(url), + std::move(isPredefined), + optionalTransform(type, NamedFilterTypeMeta::enumToStr), + std::move(canWrite), + std::move(filters), + std::move(sorters), + std::move(supportsAllIssueKinds), + std::move(issueKindRestrictions), + std::move(visibility)) + { } + + // throws std::range_error + std::optional NamedFilterInfoDto::getTypeEnum() const + { + return optionalTransform(type, NamedFilterTypeMeta::strToEnum); + } + + void NamedFilterInfoDto::setTypeEnum(std::optional newValue) + { + type = optionalTransform(newValue, NamedFilterTypeMeta::enumToStr); + } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray NamedFilterInfoDto::serialize() const + { + return serialize_bytes(*this); + } + + // NamedFilterUpdateDto + + static const QLatin1String namedFilterUpdateKeyName{"name"}; + static const QLatin1String namedFilterUpdateKeyFilters{"filters"}; + static const QLatin1String namedFilterUpdateKeySorters{"sorters"}; + static const QLatin1String namedFilterUpdateKeyVisibility{"visibility"}; + + template<> + class de_serializer final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static NamedFilterUpdateDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject(json); + return { + deserialize_field>(jo, namedFilterUpdateKeyName), + deserialize_field>>(jo, namedFilterUpdateKeyFilters), + deserialize_field>>(jo, namedFilterUpdateKeySorters), + deserialize_field>(jo, namedFilterUpdateKeyVisibility) + }; + } + + static QJsonValue serialize(const NamedFilterUpdateDto &value) { + QJsonObject jo; + serialize_field(jo, namedFilterUpdateKeyName, value.name); + serialize_field(jo, namedFilterUpdateKeyFilters, value.filters); + serialize_field(jo, namedFilterUpdateKeySorters, value.sorters); + serialize_field(jo, namedFilterUpdateKeyVisibility, value.visibility); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + NamedFilterUpdateDto NamedFilterUpdateDto::deserialize(const QByteArray &json) + { + return deserialize_bytes(json); + } + + NamedFilterUpdateDto::NamedFilterUpdateDto( + std::optional name, + std::optional> filters, + std::optional> sorters, + std::optional visibility + ) : + name(std::move(name)), + filters(std::move(filters)), + sorters(std::move(sorters)), + visibility(std::move(visibility)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray NamedFilterUpdateDto::serialize() const + { + return serialize_bytes(*this); + } + + // ProjectInfoDto + + static const QLatin1String projectInfoKeyName{"name"}; + static const QLatin1String projectInfoKeyIssueFilterHelp{"issueFilterHelp"}; + static const QLatin1String projectInfoKeyTableMetaUri{"tableMetaUri"}; + static const QLatin1String projectInfoKeyUsers{"users"}; + static const QLatin1String projectInfoKeyVersions{"versions"}; + static const QLatin1String projectInfoKeyIssueKinds{"issueKinds"}; + static const QLatin1String projectInfoKeyHasHiddenIssues{"hasHiddenIssues"}; + + template<> + class de_serializer final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static ProjectInfoDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject(json); + return { + deserialize_field(jo, projectInfoKeyName), + deserialize_field>(jo, projectInfoKeyIssueFilterHelp), + deserialize_field>(jo, projectInfoKeyTableMetaUri), + deserialize_field>(jo, projectInfoKeyUsers), + deserialize_field>(jo, projectInfoKeyVersions), + deserialize_field>(jo, projectInfoKeyIssueKinds), + deserialize_field(jo, projectInfoKeyHasHiddenIssues) + }; + } + + static QJsonValue serialize(const ProjectInfoDto &value) { + QJsonObject jo; + serialize_field(jo, projectInfoKeyName, value.name); + serialize_field(jo, projectInfoKeyIssueFilterHelp, value.issueFilterHelp); + serialize_field(jo, projectInfoKeyTableMetaUri, value.tableMetaUri); + serialize_field(jo, projectInfoKeyUsers, value.users); + serialize_field(jo, projectInfoKeyVersions, value.versions); + serialize_field(jo, projectInfoKeyIssueKinds, value.issueKinds); + serialize_field(jo, projectInfoKeyHasHiddenIssues, value.hasHiddenIssues); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + ProjectInfoDto ProjectInfoDto::deserialize(const QByteArray &json) + { + return deserialize_bytes(json); + } + + ProjectInfoDto::ProjectInfoDto( + QString name, + std::optional issueFilterHelp, + std::optional tableMetaUri, + std::vector users, + std::vector versions, + std::vector issueKinds, + bool hasHiddenIssues + ) : + name(std::move(name)), + issueFilterHelp(std::move(issueFilterHelp)), + tableMetaUri(std::move(tableMetaUri)), + users(std::move(users)), + versions(std::move(versions)), + issueKinds(std::move(issueKinds)), + hasHiddenIssues(std::move(hasHiddenIssues)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray ProjectInfoDto::serialize() const + { + return serialize_bytes(*this); + } + + // RepositoryUpdateResponseDto + + static const QLatin1String repositoryUpdateResponseKeyMessages{"messages"}; + static const QLatin1String repositoryUpdateResponseKeyHasErrors{"hasErrors"}; + static const QLatin1String repositoryUpdateResponseKeyHasWarnings{"hasWarnings"}; + + template<> + class de_serializer final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static RepositoryUpdateResponseDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject(json); + return { + deserialize_field>(jo, repositoryUpdateResponseKeyMessages), + deserialize_field(jo, repositoryUpdateResponseKeyHasErrors), + deserialize_field(jo, repositoryUpdateResponseKeyHasWarnings) + }; + } + + static QJsonValue serialize(const RepositoryUpdateResponseDto &value) { + QJsonObject jo; + serialize_field(jo, repositoryUpdateResponseKeyMessages, value.messages); + serialize_field(jo, repositoryUpdateResponseKeyHasErrors, value.hasErrors); + serialize_field(jo, repositoryUpdateResponseKeyHasWarnings, value.hasWarnings); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + RepositoryUpdateResponseDto RepositoryUpdateResponseDto::deserialize(const QByteArray &json) + { + return deserialize_bytes(json); + } + + RepositoryUpdateResponseDto::RepositoryUpdateResponseDto( + std::vector messages, + bool hasErrors, + bool hasWarnings + ) : + messages(std::move(messages)), + hasErrors(std::move(hasErrors)), + hasWarnings(std::move(hasWarnings)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray RepositoryUpdateResponseDto::serialize() const + { + return serialize_bytes(*this); + } + + // TableInfoDto + + static const QLatin1String tableInfoKeyTableDataUri{"tableDataUri"}; + static const QLatin1String tableInfoKeyIssueBaseViewUri{"issueBaseViewUri"}; + static const QLatin1String tableInfoKeyColumns{"columns"}; + static const QLatin1String tableInfoKeyFilters{"filters"}; + static const QLatin1String tableInfoKeyUserDefaultFilter{"userDefaultFilter"}; + static const QLatin1String tableInfoKeyAxivionDefaultFilter{"axivionDefaultFilter"}; + + template<> + class de_serializer final + { + public: + // throws Axivion::Internal::Dto::invalid_dto_exception + static TableInfoDto deserialize(const QJsonValue &json) { + const QJsonObject jo = toJsonObject(json); + return { + deserialize_field(jo, tableInfoKeyTableDataUri), + deserialize_field>(jo, tableInfoKeyIssueBaseViewUri), + deserialize_field>(jo, tableInfoKeyColumns), + deserialize_field>(jo, tableInfoKeyFilters), + deserialize_field>(jo, tableInfoKeyUserDefaultFilter), + deserialize_field(jo, tableInfoKeyAxivionDefaultFilter) + }; + } + + static QJsonValue serialize(const TableInfoDto &value) { + QJsonObject jo; + serialize_field(jo, tableInfoKeyTableDataUri, value.tableDataUri); + serialize_field(jo, tableInfoKeyIssueBaseViewUri, value.issueBaseViewUri); + serialize_field(jo, tableInfoKeyColumns, value.columns); + serialize_field(jo, tableInfoKeyFilters, value.filters); + serialize_field(jo, tableInfoKeyUserDefaultFilter, value.userDefaultFilter); + serialize_field(jo, tableInfoKeyAxivionDefaultFilter, value.axivionDefaultFilter); + return { jo }; + } + + de_serializer() = delete; + ~de_serializer() = delete; + }; + + // throws Axivion::Internal::Dto::invalid_dto_exception + TableInfoDto TableInfoDto::deserialize(const QByteArray &json) + { + return deserialize_bytes(json); + } + + TableInfoDto::TableInfoDto( + QString tableDataUri, + std::optional issueBaseViewUri, + std::vector columns, + std::vector filters, + std::optional userDefaultFilter, + QString axivionDefaultFilter + ) : + tableDataUri(std::move(tableDataUri)), + issueBaseViewUri(std::move(issueBaseViewUri)), + columns(std::move(columns)), + filters(std::move(filters)), + userDefaultFilter(std::move(userDefaultFilter)), + axivionDefaultFilter(std::move(axivionDefaultFilter)) + { } + + // throws Axivion::Internal::Dto::invalid_dto_exception + QByteArray TableInfoDto::serialize() const + { + return serialize_bytes(*this); + } +} diff --git a/src/plugins/axivion/dashboard/dto.h b/src/plugins/axivion/dashboard/dto.h new file mode 100644 index 00000000000..fe36257afb2 --- /dev/null +++ b/src/plugins/axivion/dashboard/dto.h @@ -0,0 +1,2994 @@ +#pragma once + +/* + * Copyright (C) 2022-current by Axivion GmbH + * https://www.axivion.com/ + * + * SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + * + * Purpose: Dashboard C++ API Header + * + * !!!!!! GENERATED, DO NOT EDIT !!!!!! + * + * This file was generated with the script at + * /projects/libs/dashboard_cpp_api/generator/generate_dashboard_cpp_api.py + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace Axivion::Internal::Dto +{ + class invalid_dto_exception : public std::runtime_error + { + public: + invalid_dto_exception(const std::string_view type_name, const std::exception &ex); + + invalid_dto_exception(const std::string_view type_name, const std::string_view message); + }; + + template + std::optional optionalTransform(const std::optional &input, const std::function &transformer) + { + if (input.has_value()) + { + return transformer(*input); + } + return std::nullopt; + } + + class Serializable + { + public: + virtual QByteArray serialize() const = 0; + + virtual ~Serializable() = default; + }; + + class Any : public Serializable { + private: + std::variant< + std::nullptr_t, // .index() == 0 + QString, // .index() == 1 + double, // .index() == 2 + std::map, // .index() == 3 + std::vector, // .index() == 4 + bool // .index() == 5 + > data; + + public: + // Throws Axivion::Internal::Dto::invalid_dto_exception + static Any deserialize(const QByteArray &json); + + Any(); + + Any(QString value); + + Any(double value); + + Any(std::map value); + + Any(std::vector value); + + Any(bool value); + + bool isNull() const; + + bool isString() const; + + // Throws std::bad_variant_access + QString &getString(); + + // Throws std::bad_variant_access + const QString &getString() const; + + bool isDouble() const; + + // Throws std::bad_variant_access + double &getDouble(); + + // Throws std::bad_variant_access + const double &getDouble() const; + + bool isMap() const; + + // Throws std::bad_variant_access + std::map &getMap(); + + // Throws std::bad_variant_access + const std::map &getMap() const; + + bool isList() const; + + // Throws std::bad_variant_access + std::vector &getList(); + + // Throws std::bad_variant_access + const std::vector &getList() const; + + bool isBool() const; + + // Throws std::bad_variant_access + bool &getBool(); + + // Throws std::bad_variant_access + const bool &getBool() const; + + virtual QByteArray serialize() const override; + }; + + class ApiVersion { + public: + static const std::array number; + static const QLatin1String string; + static const QLatin1String name; + static const QLatin1String timestamp; + }; + + /** + * Describes an analyzed file in a version. + */ + class AnalyzedFileDto : public Serializable + { + public: + + /** + *

The absolute path of the file. + */ + QString path; + + /** + *

Indicates whether this file is a system header file. + */ + std::optional isSystemHeader; + + /** + *

The name of the language used to analyze this file. + */ + std::optional languageName; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static AnalyzedFileDto deserialize(const QByteArray &json); + + AnalyzedFileDto( + QString path, + std::optional isSystemHeader, + std::optional languageName + ); + + virtual QByteArray serialize() const override; + }; + + /** + * Available types of ApiToken + * + *

* `General` - Powerful token kind granting the same permissions as + * a regular password based login. + * * `IdePlugin` - Limits user permissions to those typically needed by IDE + * plugins. + * * `SourceFetch` - Used internally for local build. Cannot be created via this API. + * * `LogIn` - Used internally by browsers for the "Keep me logged in" functionality. Cannot be created via this API. + * * `ContinuousIntegration` - Limits user permissions to those typically needed for CI purposes. + * + *

For the types `IdePlugin` and `LogIn` the Dashboard will automatically + * delete the tokens when the owner changes his password. The Dashboard + * will try to detect this for external password changes as well + * but cannot guarantee this will always work. + * + * @since 7.1.0 + */ + enum class ApiTokenType + { + sourcefetch, + general, + ideplugin, + login, + continuousintegration + }; + + class ApiTokenTypeMeta final + { + public: + static const QLatin1String sourcefetch; + static const QLatin1String general; + static const QLatin1String ideplugin; + static const QLatin1String login; + static const QLatin1String continuousintegration; + + // Throws std::range_error + static ApiTokenType strToEnum(QAnyStringView str); + + static QLatin1String enumToStr(ApiTokenType e); + + ApiTokenTypeMeta() = delete; + ~ApiTokenTypeMeta() = delete; + }; + + /** + * Request data for changing a user password + */ + class ChangePasswordFormDto : public Serializable + { + public: + + /** + *

The current password + */ + QString currentPassword; + + /** + *

The new password + */ + QString newPassword; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static ChangePasswordFormDto deserialize(const QByteArray &json); + + ChangePasswordFormDto( + QString currentPassword, + QString newPassword + ); + + virtual QByteArray serialize() const override; + }; + + /** + * Additional TypeInfo of a ColumnType + */ + class ColumnTypeOptionDto : public Serializable + { + public: + + /** + *

The name of the option that shall be used for displaying and filtering as well. + */ + QString key; + + /** + *

Name for displaying the option in UIs. + * + *

Deprecated since 6.9.0. Use `key` instead. # Older aclipse versions rely on the field being non-null + * + * @deprecated + */ + std::optional displayName; + + /** + *

A color hex code recommended for displaying the value in GUIs. + * + *

Example colors are: "#FF0000" - red "#008000" - green + */ + QString displayColor; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static ColumnTypeOptionDto deserialize(const QByteArray &json); + + ColumnTypeOptionDto( + QString key, + std::optional displayName, + QString displayColor + ); + + virtual QByteArray serialize() const override; + }; + + /** + * Describes a Comment Request + */ + class CommentRequestDto : public Serializable + { + public: + + /** + *

The comment text + */ + QString text; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static CommentRequestDto deserialize(const QByteArray &json); + + CommentRequestDto( + QString text + ); + + virtual QByteArray serialize() const override; + }; + + /** + * A Project Entity such as a Class, a Method, a File or a Module + * or the System Entity. + */ + class EntityDto : public Serializable + { + public: + + /** + *

The project-wide ID used to refer to this entity. + */ + QString id; + + /** + *

a non-unique name of the entity + */ + QString name; + + /** + *

The type of the entity + */ + QString type; + + /** + *

The file path of an entity if it can be associated with a file + */ + std::optional path; + + /** + *

The line number of an entity if it can be associated with a file location + */ + std::optional line; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static EntityDto deserialize(const QByteArray &json); + + EntityDto( + QString id, + QString name, + QString type, + std::optional path, + std::optional line + ); + + virtual QByteArray serialize() const override; + }; + + /** + * Describes an error returned from the server + * + *

Usually they are caused by wrong API usage but they may also happen + * in case of bugs in the server + */ + class ErrorDto : public Serializable + { + public: + + /** + *

a parseable version number indicating the server version + * + * @since 6.6.0 + */ + std::optional dashboardVersionNumber; + + /** + *

the name of the error kind + */ + QString type; + + /** + *

A human readable short english message describing the error. + * Ideally it does not contain any linebreaks. + */ + QString message; + + /** + *

use this instead of message in order to display a message translated + * according to your language preferences. Will contain exactly the same + * contents as `message` in case no translation is available. + */ + QString localizedMessage; + + /** + *

Optional error details. + * Consumers should expect this to be a multiline string and display it + * in a mono-space font without adding additional linebreaks. + * + * @since 7.5.0 + */ + std::optional details; + + /** + *

Optional translation of `details` according to your language preferences. + * Will not be available in case no translation is available. + * + * @since 7.5.0 + */ + std::optional localizedDetails; + + /** + *

E-mail address for support requests + * + * @since 7.5.0 + */ + std::optional supportAddress; + + /** + *

If this is `true`, this is an indication by the server, that this error + * is probably a bug on server-side and clients are encouraged to encourage + * users to escalate this problem, e.g. using `supportAddress`. + * + *

Keep in mind that this boolean may be wrong in both directions, e.g.: + * * if a timeout is configured too low, then this can be a false positive + * * if the bug lies in the exception judgment than this is a false negative + * + *

So it should always be clear to users that they have the ultimate choice + * on what to do with an error popup. + * + * @since 7.5.0 + */ + std::optional displayServerBugHint; + + /** + *

Optional field containing additional error information meant for automatic processing. + * + *

* This data is meant for helping software that uses the API to better understand and communicate + * certain types of error to the user. + * * Always inspect the `type` so you know what keys you can expect. + * + *

Error types having additional information: + * + *

* type = InvalidFilterException (since 6.5.0): + * + *

* optionally has a string datum 'column' referencing the column that has the invalid + * filter value. The file filter is referred to by the string "any path". + * * optionally has a string datum 'help' providing an ascii-encoded URL + * pointing to human-readable help that might help a user understanding + * and resolving the error. If the URL is relative, then it is meant + * relative to the Dashboard the error originated from. + * + *

* type = PasswordVerificationException (since 7.1.0): + * + *

* optionally has a boolean flag 'passwordMayBeUsedAsApiToken' to indicate that the + * provided password may be used as API token with the respective API. E.g. use + * 'Authorization: AxToken ...' header instead of HTTP basic auth. + * + * @since 6.5.0 + */ + std::optional> data; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static ErrorDto deserialize(const QByteArray &json); + + ErrorDto( + std::optional dashboardVersionNumber, + QString type, + QString message, + QString localizedMessage, + std::optional details, + std::optional localizedDetails, + std::optional supportAddress, + std::optional displayServerBugHint, + std::optional> data + ); + + virtual QByteArray serialize() const override; + }; + + /** + * Describes an issue comment + */ + class IssueCommentDto : public Serializable + { + public: + + /** + *

The loginname of the user that created the comment. + */ + QString username; + + /** + *

The recommended display name of the user that wrote the comment. + */ + QString userDisplayName; + + /** + *

The Date when the comment was created as a ISO8601-parseable string. + */ + QString date; + + /** + *

The Date when the comment was created for UI-display. + * + *

It is formatted as a human-readable string relative to query time, e.g. + * ``2 minutes ago``. + */ + QString displayDate; + + /** + *

The comment text. + */ + QString text; + + /** + *

The linkified comment text. + * + * @since 7.6.0 + */ + std::optional html; + + /** + *

The id for comment deletion. + * + *

When the requesting user is allowed to delete the comment, contains an id + * that can be used to mark the comment as deleted using another API. This is + * never set when the Comment is returned as the result of an Issue-List query. + */ + std::optional commentDeletionId; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static IssueCommentDto deserialize(const QByteArray &json); + + IssueCommentDto( + QString username, + QString userDisplayName, + QString date, + QString displayDate, + QString text, + std::optional html, + std::optional commentDeletionId + ); + + virtual QByteArray serialize() const override; + }; + + /** + * Shortname for an erosion issue kind + * + *

one of ``AV``, ``CL``, ``CY``, ``DE``, ``MV``, ``SV`` + */ + enum class IssueKind + { + av, + cl, + cy, + de, + mv, + sv + }; + + class IssueKindMeta final + { + public: + static const QLatin1String av; + static const QLatin1String cl; + static const QLatin1String cy; + static const QLatin1String de; + static const QLatin1String mv; + static const QLatin1String sv; + + // Throws std::range_error + static IssueKind strToEnum(QAnyStringView str); + + static QLatin1String enumToStr(IssueKind e); + + IssueKindMeta() = delete; + ~IssueKindMeta() = delete; + }; + + /** + * IssueKind for Named-Filter creation + * + *

one of ``AV``, ``CL``, ``CY``, ``DE``, ``MV``, ``SV``, ``UNIVERSAL`` + */ + enum class IssueKindForNamedFilterCreation + { + av, + cl, + cy, + de, + mv, + sv, + universal + }; + + class IssueKindForNamedFilterCreationMeta final + { + public: + static const QLatin1String av; + static const QLatin1String cl; + static const QLatin1String cy; + static const QLatin1String de; + static const QLatin1String mv; + static const QLatin1String sv; + static const QLatin1String universal; + + // Throws std::range_error + static IssueKindForNamedFilterCreation strToEnum(QAnyStringView str); + + static QLatin1String enumToStr(IssueKindForNamedFilterCreation e); + + IssueKindForNamedFilterCreationMeta() = delete; + ~IssueKindForNamedFilterCreationMeta() = delete; + }; + + /** + *

Identifies a source code location which may be a single line of code or an + * couple of adjacent lines (fragment) inside the same source file. + */ + class IssueSourceLocationDto : public Serializable + { + public: + + /** + *

Refers to the file with a normalized path relative to the current project + * root. + */ + QString fileName; + + /** + *

A user-readable description of this source location's role in the + * issue (e.g. 'Source' or 'Target') + */ + std::optional role; + + /** + *

Host-relative URL of the source code version for which these + * startLine/endLine values are valid + */ + QString sourceCodeUrl; + + /** + *

The first line of the fragment + */ + qint32 startLine; + + /** + * The column of the start line in which the issue starts. + * + *

1-relative + * + *

0 iff unknown + * + * @since 7.2.0 + */ + qint32 startColumn; + + /** + * The last line of the fragment (inclusive) + * + *

This is the same as `startLine` if the location has only one line. + */ + qint32 endLine; + + /** + * The column of the end line in which the issue ends. + * + *

1-relative + * + *

0 iff unknown + * + * @since 7.2.0 + */ + qint32 endColumn; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static IssueSourceLocationDto deserialize(const QByteArray &json); + + IssueSourceLocationDto( + QString fileName, + std::optional role, + QString sourceCodeUrl, + qint32 startLine, + qint32 startColumn, + qint32 endLine, + qint32 endColumn + ); + + virtual QByteArray serialize() const override; + }; + + /** + * An issue tag as returned by the Issue-List API. + */ + class IssueTagDto : public Serializable + { + public: + + /** + *

Use this for displaying the tag + */ + QString tag; + + /** + *

An RGB hex color in the form #RRGGBB directly usable by css. + * + *

The colors are best suited to draw a label on bright background and to + * contain white letters for labeling. + */ + QString color; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static IssueTagDto deserialize(const QByteArray &json); + + IssueTagDto( + QString tag, + QString color + ); + + virtual QByteArray serialize() const override; + }; + + /** + * Describes an issue tag as returned by the Issue-Tags API. + */ + class IssueTagTypeDto : public Serializable + { + public: + + /** + *

A canonicalized variant of the tag name that can be used for client-side equality checks and sorting. + */ + QString id; + + /** + *

Deprecated since 6.9.0, use ``tag`` instead. + * + * @deprecated + */ + std::optional text; + + /** + *

Use this for displaying the tag + * + * @since 6.9.0 + */ + std::optional tag; + + /** + *

An RGB hex color in the form #RRGGBB directly usable by css. + * + *

The colors are best suited to draw a label on bright background and to + * contain white letters for labeling. + */ + QString color; + + /** + *

The description of the tag. It can be assumed to be plain text with no need for further + * syntactic interpretation. + */ + std::optional description; + + /** + *

Whether the tag is attached to the issue or only proposed. + */ + std::optional selected; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static IssueTagTypeDto deserialize(const QByteArray &json); + + IssueTagTypeDto( + QString id, + std::optional text, + std::optional tag, + QString color, + std::optional description, + std::optional selected + ); + + virtual QByteArray serialize() const override; + }; + + /** + * The log-level of a message + * + *

* `DEBUG` + * * `INFO` + * * `WARNING` + * * `ERROR` + * * `FATAL` + */ + enum class MessageSeverity + { + debug, + info, + warning, + error, + fatal + }; + + class MessageSeverityMeta final + { + public: + static const QLatin1String debug; + static const QLatin1String info; + static const QLatin1String warning; + static const QLatin1String error; + static const QLatin1String fatal; + + // Throws std::range_error + static MessageSeverity strToEnum(QAnyStringView str); + + static QLatin1String enumToStr(MessageSeverity e); + + MessageSeverityMeta() = delete; + ~MessageSeverityMeta() = delete; + }; + + /** + * Describes a Metric as configured for a project in a version + */ + class MetricDto : public Serializable + { + public: + + /** + *

The ID of the metric + */ + QString name; + + /** + *

a more descriptive name of the metric + */ + QString displayName; + + /** + *

The configured minimum threshold for the metric. + * + *

Can have two possible string values ``-Infinity`` and ``Infinity`` + * otherwise it is a number. If not configured, this field will not + * be available. + */ + Any minValue; + + /** + *

The configured maximum threshold for the metric. + * + *

Can have two possible string values ``-Infinity`` and ``Infinity`` + * otherwise it is a number. If not configured, this field will not + * be available. + */ + Any maxValue; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static MetricDto deserialize(const QByteArray &json); + + MetricDto( + QString name, + QString displayName, + Any minValue, + Any maxValue + ); + + virtual QByteArray serialize() const override; + }; + + /** + * An entity table row + * + *

Note, that if you specify ``forceStrings=true`` when querying the table, + * the field types will all be ``string`` and the empty string will indicate + * an absent value. + */ + class MetricValueTableRowDto : public Serializable + { + public: + + /** + *

The Metric Id + */ + QString metric; + + /** + *

The source file of the entity definition + */ + std::optional path; + + /** + *

The source file line number of the entity definition + */ + std::optional line; + + /** + *

The measured or aggregated metric value + */ + std::optional value; + + /** + *

The non-unique entity name + */ + QString entity; + + /** + *

The entity type + */ + QString entityType; + + /** + *

The project-wide entity ID + */ + QString entityId; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static MetricValueTableRowDto deserialize(const QByteArray &json); + + MetricValueTableRowDto( + QString metric, + std::optional path, + std::optional line, + std::optional value, + QString entity, + QString entityType, + QString entityId + ); + + virtual QByteArray serialize() const override; + }; + + /** + * A named filter type + * + *

* `PREDEFINED` - Named filters of this type are immutable and exist out of the box and can be used by everyone + * * `GLOBAL` - Named filters of this type are usable by everyone and managed by the so called filter managers + * * `CUSTOM` - Named filters of this type are creatable by everyone but only visible to their owner + */ + enum class NamedFilterType + { + predefined, + global, + custom + }; + + class NamedFilterTypeMeta final + { + public: + static const QLatin1String predefined; + static const QLatin1String global; + static const QLatin1String custom; + + // Throws std::range_error + static NamedFilterType strToEnum(QAnyStringView str); + + static QLatin1String enumToStr(NamedFilterType e); + + NamedFilterTypeMeta() = delete; + ~NamedFilterTypeMeta() = delete; + }; + + /** + * NamedFilter visibility configuration + * + *

Only applicable for global named filters. + * + *

You may not have access to this information depending on your permissions. + * + * @since 7.3.0 + */ + class NamedFilterVisibilityDto : public Serializable + { + public: + + /** + *

IDs of user-groups, that are allowed to see the named filter. + * + *

The named filter is visible to all users, if this property is not given. + */ + std::optional> groups; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static NamedFilterVisibilityDto deserialize(const QByteArray &json); + + NamedFilterVisibilityDto( + std::optional> groups + ); + + virtual QByteArray serialize() const override; + }; + + /** + * A reference to a project + */ + class ProjectReferenceDto : public Serializable + { + public: + + /** + *

The name of the project. Use this string to refer to the project. + */ + QString name; + + /** + *

URI to get further information about the project. + */ + QString url; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static ProjectReferenceDto deserialize(const QByteArray &json); + + ProjectReferenceDto( + QString name, + QString url + ); + + virtual QByteArray serialize() const override; + }; + + /** + * A rule configured on a project + * + * @since 6.5.0 + */ + class RuleDto : public Serializable + { + public: + + /** + *

the rule name (possibly renamed via configuration) + */ + QString name; + + /** + *

the original (unrenamed) rule name + */ + QString original_name; + + /** + *

Whether or not the rule was disabled. + * + *

Note, that this value is only available for analysis runs + * done with at least 6.5.0 + */ + std::optional disabled; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static RuleDto deserialize(const QByteArray &json); + + RuleDto( + QString name, + QString original_name, + std::optional disabled + ); + + virtual QByteArray serialize() const override; + }; + + /** + * A sorting direction + * + *

* `ASC` - `smaller` values first + * * `DESC` - `greater` values first + */ + enum class SortDirection + { + asc, + desc + }; + + class SortDirectionMeta final + { + public: + static const QLatin1String asc; + static const QLatin1String desc; + + // Throws std::range_error + static SortDirection strToEnum(QAnyStringView str); + + static QLatin1String enumToStr(SortDirection e); + + SortDirectionMeta() = delete; + ~SortDirectionMeta() = delete; + }; + + /** + * How the column values should be aligned. + * + *

* `left` - Align value to the left of its cell + * * `right` - Align value to the right of its cell + * * `center` - Center value in its cell + */ + enum class TableCellAlignment + { + left, + right, + center + }; + + class TableCellAlignmentMeta final + { + public: + static const QLatin1String left; + static const QLatin1String right; + static const QLatin1String center; + + // Throws std::range_error + static TableCellAlignment strToEnum(QAnyStringView str); + + static QLatin1String enumToStr(TableCellAlignment e); + + TableCellAlignmentMeta() = delete; + ~TableCellAlignmentMeta() = delete; + }; + + /** + * Refers to a specific version of the Axivion Suite + */ + class ToolsVersionDto : public Serializable + { + public: + + /** + *

Version number for display purposes + */ + QString name; + + /** + *

Parseable, numeric version number suitable for version comparisons + */ + QString number; + + /** + *

Build date in an ISO8601-parseable string of the form YYYY-MM-DD + */ + QString buildDate; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static ToolsVersionDto deserialize(const QByteArray &json); + + ToolsVersionDto( + QString name, + QString number, + QString buildDate + ); + + virtual QByteArray serialize() const override; + }; + + /** + * User Type + * + *

* `VIRTUAL_USER` - virtual user that does not represent a specific person + * * `DASHBOARD_USER` - a `regular`, explicitly managed user + * * `UNMAPPED_USER` - a user that is not explicitly managed and e.g. only known via an analysis result + * + * @since 7.1.0 + */ + enum class UserRefType + { + virtual_user, + dashboard_user, + unmapped_user + }; + + class UserRefTypeMeta final + { + public: + static const QLatin1String virtual_user; + static const QLatin1String dashboard_user; + static const QLatin1String unmapped_user; + + // Throws std::range_error + static UserRefType strToEnum(QAnyStringView str); + + static QLatin1String enumToStr(UserRefType e); + + UserRefTypeMeta() = delete; + ~UserRefTypeMeta() = delete; + }; + + /** + * Kind-specific issue count statistics that are cheaply available. + */ + class VersionKindCountDto : public Serializable + { + public: + + /** + *

The number of issues of a kind in a version. + */ + qint32 Total; + + /** + *

The number of issues of a kind present in a version that were not present in the previous version. + */ + qint32 Added; + + /** + *

The number of issues of a kind that were present in the previous version and are not present in the current version any more. + */ + qint32 Removed; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static VersionKindCountDto deserialize(const QByteArray &json); + + VersionKindCountDto( + qint32 Total, + qint32 Added, + qint32 Removed + ); + + virtual QByteArray serialize() const override; + }; + + /** + * Describes the version of analysis data of a certain Project. + */ + class AnalysisVersionDto : public Serializable + { + public: + + /** + *

The ID used to refer to an `AnalysisVersion` in this API. + * + *

ISO8601 compatible date-strings that are guaranteed to + * contain time zone information. + * + *

An example version string is `2020-11-23T09:37:04.797286Z`. + * + *

The precision of these dates is undefined, thus in order to be sure to refer + * to exactly the same version when specifying a version as an argument e.g. + * when querying issues, you must use this exact string. + * + *

If you want to interpret the version-date e.g. for passing it to a + * graph-drawing library or to order a list of `AnalysisVersion`s, + * it is easier to use the field `millis` instead of parsing these dates. + */ + QString date; + + /** + *

Optional label of the version. + * + * @since 7.6.0 + */ + std::optional label; + + /** + *

The 0-based index of all the known analysis versions of a project. + * + *

The version with index 0 never contains actual analysis data but always + * refers to a fictional version without any issues that happened before + * version 1. + */ + qint32 index; + + /** + *

The legacy display name of a version. + * + *

It is not recommended to use this anymore. It contains the + * date of the analysis version creation in an arbitrary time zone which is not + * indicated in the timestamp. In recent versions most probably UTC is used but + * this can change at any time - which would be regarded as a non-breaking + * change. + * + *

Instead, clients should craft their own display name from the other + * available properties (date, label) and maybe adjust displayed dates + * according to their system timezone. + * + * @deprecated + */ + std::optional name; + + /** + *

Analysis version timestamp in milliseconds + * + *

The number of milliseconds passed since 1970-01-01T00:00:00 UTC + * + *

Meant for programmatic interpretation of the actual instant in time that + * represents a version. + */ + qint64 millis; + + /** + *

For every Issue Kind contains some Issue counts. + * + *

Namely the Total count, as well as the newly Added and newly Removed issues in comparison + * with the version before. + * + *

N.B. The Bauhaus Version used to analyze the project must be at least 6.5.0 in order for + * these values to be available. + * + * @since 6.6.0 + */ + Any issueCounts; + + /** + * Refers to a specific version of the Axivion Suite + * + *

Version information of the Axivion Suite used to do this analysis run. + * + *

Note, that this field is only available when the analysis was done with at least version + * 6.5.0. + * + * @since 6.9.15 + */ + std::optional toolsVersion; + + /** + *

The total lines of code of the project at the current version if available + * + * @since 7.0.4 + */ + std::optional linesOfCode; + + /** + *

The clone ratio of the project at the current version if available + * + * @since 7.0.4 + */ + std::optional cloneRatio; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static AnalysisVersionDto deserialize(const QByteArray &json); + + AnalysisVersionDto( + QString date, + std::optional label, + qint32 index, + std::optional name, + qint64 millis, + Any issueCounts, + std::optional toolsVersion, + std::optional linesOfCode, + std::optional cloneRatio + ); + + virtual QByteArray serialize() const override; + }; + + /** + * Contains Request-Data for creating an ApiToken + * + * @since 7.1.0 + */ + class ApiTokenCreationRequestDto : public Serializable + { + public: + + /** + *

Dashboard password of the user that requests the token creation + */ + QString password; + + /** + * Available types of ApiToken + * + *

the type of the token to create + * + * @since 7.1.0 + */ + QString type; + + /** + *

Purpose of the Token + */ + QString description; + + /** + *

Used for configuring the Token expiration. + * + *

* positive values are maxAge in milliseconds + * * 0 means: choose a default for me (recommended) + * * negative values are not allowed + * + *

Note, that the server clock is decisive for when the actual token expiration will occur. + * Expired tokens will be invalidated or deleted on the server depending on their type. + */ + qint64 maxAgeMillis; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static ApiTokenCreationRequestDto deserialize(const QByteArray &json); + + ApiTokenCreationRequestDto( + QString password, + QString type, + QString description, + qint64 maxAgeMillis + ); + + ApiTokenCreationRequestDto( + QString password, + ApiTokenType type, + QString description, + qint64 maxAgeMillis + ); + + // Throws std::range_error + ApiTokenType getTypeEnum() const; + + void setTypeEnum(ApiTokenType newValue); + + virtual QByteArray serialize() const override; + }; + + /** + * Contains Meta-Data of an ApiToken + * + *

When this is returned as response of a creation request it will also + * contain the token secret + * + * @since 7.1.0 + */ + class ApiTokenInfoDto : public Serializable + { + public: + + /** + *

The unique Token-ID. + */ + QString id; + + /** + *

The token URL + */ + QString url; + + /** + *

Whether the token was still valid at query time. + * + *

Invalid Tokens are effectively tombstones and cannot be used for + * authentication any more. + * Note, that this field is no indication on whether or not this object + * is transporting the secret. + */ + bool isValid; + + /** + * Available types of ApiToken + * + *

The type of the Token + * + * @since 7.1.0 + */ + QString type; + + /** + *

Description that was given on token creation. + */ + QString description; + + /** + *

The secret token value. + * + *

This is only initialized upon token creation. Use this to authenticate + * against the Dashboard as described in :ref:`authentication`. + */ + std::optional token; + + /** + *

ISO8601 format date string + */ + QString creationDate; + + /** + *

Alternative representation of the token creation date, like "2 days ago" etc + */ + QString displayCreationDate; + + /** + *

ISO8601 format date string + */ + QString expirationDate; + + /** + *

Alternative representation of the token expiration date, like "3 months from now" etc + */ + QString displayExpirationDate; + + /** + *

ISO8601 format date if the token has already been used + */ + std::optional lastUseDate; + + /** + *

Alternative representation of the token last use date, e.g. "2 days ago" or "Never" + */ + QString displayLastUseDate; + + /** + *

Whether this token is used by the current request. + * + *

Deletion of this token will invalidate the currently used credentials + */ + bool usedByCurrentRequest; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static ApiTokenInfoDto deserialize(const QByteArray &json); + + ApiTokenInfoDto( + QString id, + QString url, + bool isValid, + QString type, + QString description, + std::optional token, + QString creationDate, + QString displayCreationDate, + QString expirationDate, + QString displayExpirationDate, + std::optional lastUseDate, + QString displayLastUseDate, + bool usedByCurrentRequest + ); + + ApiTokenInfoDto( + QString id, + QString url, + bool isValid, + ApiTokenType type, + QString description, + std::optional token, + QString creationDate, + QString displayCreationDate, + QString expirationDate, + QString displayExpirationDate, + std::optional lastUseDate, + QString displayLastUseDate, + bool usedByCurrentRequest + ); + + // Throws std::range_error + ApiTokenType getTypeEnum() const; + + void setTypeEnum(ApiTokenType newValue); + + virtual QByteArray serialize() const override; + }; + + /** + * Represents a table column. + */ + class ColumnInfoDto : public Serializable + { + public: + + /** + *

Key used to identify the column in the rows and for sorting/filtering. + * + *

For Issue-Table columns, see :ref:`column <issue-table-columns>`. + */ + QString key; + + /** + *

Nice header name for the column for UI display purposes. + */ + std::optional header; + + /** + *

Specifies whether this column can be sorted. + */ + bool canSort; + + /** + *

Specifies whether this column can be filtered. + */ + bool canFilter; + + /** + * How the column values should be aligned. + * + *

How the column values should be aligned. + */ + QString alignment; + + /** + *

The column type. + * + *

Possible values: + * * `string` - a unicode string or ``null`` + * * `number` - either ``null`` or ``"Infinity"`` or ``"-Infinity"`` or ``"NaN"`` (string!) or a decimal number with base 10. + * * `state` - The fields are strings. Possible values are defined via ``typeOptions``. + * * `boolean` - The fields are boolean values, either ``false`` or ``true``. Has ``typeOptions``. + * * `path` - **Since 6.4.1** similar to ``string`` or ``null``, however they are normalized (guaranteed single-slash separators) for easy parsing as path + * * `tags` - **Since 6.5.0** an array of :json:object:`IssueTag` + * * `comments` - **Since 6.9.0** array of :json:object:`IssueComment` + * * `owners` - **Since 7.0.0** array of :json:object:`UserRef` + */ + QString type; + + /** + *

Describes possible values for the field. + * + *

Currently this is only used for the types ``state`` and ``boolean``. + * In case of type ``boolean`` this always contains exactly 2 elements, + * the first describing the false-equivalent, the second describing the + * true-equivalent. In case of type ``state`` this contains the possible string + * values the field may have. + */ + std::optional> typeOptions; + + /** + *

Suggested column width in pixels + */ + qint32 width; + + /** + *

whether a gui should show this column by default. + */ + bool showByDefault; + + /** + *

Key used to identify a column that provides the hyperlink targets + * for this column ('ErrorLink' or null) + */ + std::optional linkKey; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static ColumnInfoDto deserialize(const QByteArray &json); + + ColumnInfoDto( + QString key, + std::optional header, + bool canSort, + bool canFilter, + QString alignment, + QString type, + std::optional> typeOptions, + qint32 width, + bool showByDefault, + std::optional linkKey + ); + + ColumnInfoDto( + QString key, + std::optional header, + bool canSort, + bool canFilter, + TableCellAlignment alignment, + QString type, + std::optional> typeOptions, + qint32 width, + bool showByDefault, + std::optional linkKey + ); + + // Throws std::range_error + TableCellAlignment getAlignmentEnum() const; + + void setAlignmentEnum(TableCellAlignment newValue); + + virtual QByteArray serialize() const override; + }; + + /** + * Main API endpoint response + */ + class DashboardInfoDto : public Serializable + { + public: + + /** + *

The complete dashboard base URL. + * + *

Use this to point your browser to the Dashboard or + * combine it with the other host-relative URLs returned by this API + * in order to get complete URLs. + * + *

Note, that this URL may be different from the URL you are currently + * accessing the Dashboard with for various reasons. + * + *

Also note, that the Dashboard cannot always know the proper value + * to return here, e.g. when running behind a proxy. So an administrator + * might need to help out the Dashboard by configuring the proper value + * in the global settings. + * + * @since 7.4.0 + */ + std::optional mainUrl; + + /** + *

Axivion Dashboard version serving this API. + */ + QString dashboardVersion; + + /** + *

Parseable Axivion Dashboard Version. + * + * @since 6.6.0 + */ + std::optional dashboardVersionNumber; + + /** + *

Dashboard Server Build date. + */ + QString dashboardBuildDate; + + /** + *

Name of the successfully authenticated user if a dashboard-user is associated with the request. + */ + std::optional username; + + /** + *

The HTTP-Request Header expected present for all HTTP requests that are not GET, HEAD, OPTIONS or TRACE. + */ + QString csrfTokenHeader; + + /** + *

The value expected to be sent along the ``csrfTokenHeader`` for all HTTP requests that are not GET, HEAD, OPTIONS or TRACE. + * + *

Note, that this does not replace authentication of subsequent requests. Also the token is combined with the authentication + * data, so will not work when authenticating as another user. Its lifetime is limited, so when creating a very long-running + * application you should consider refreshing this token from time to time. + */ + QString csrfToken; + + /** + *

An URI that can be used to check credentials via GET. It returns `"ok"` in case of valid credentials. + * + * @since 6.5.4 + */ + std::optional checkCredentialsUrl; + + /** + *

Endpoint for managing global named filters + * + * @since 7.3.0 + */ + std::optional namedFiltersUrl; + + /** + *

List of references to the projects visible to the authenticated user. + */ + std::optional> projects; + + /** + *

Endpoint for creating and listing api tokens of the current user + * + * @since 7.1.0 + */ + std::optional userApiTokenUrl; + + /** + *

Endpoint for managing custom named filters of the current user + * + * @since 7.3.0 + */ + std::optional userNamedFiltersUrl; + + /** + *

E-mail address for support requests + * + * @since 7.4.3 + */ + std::optional supportAddress; + + /** + *

A host-relative URL that can be used to display filter-help meant for humans. + * + * @since 7.4.3 + */ + std::optional issueFilterHelp; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static DashboardInfoDto deserialize(const QByteArray &json); + + DashboardInfoDto( + std::optional mainUrl, + QString dashboardVersion, + std::optional dashboardVersionNumber, + QString dashboardBuildDate, + std::optional username, + QString csrfTokenHeader, + QString csrfToken, + std::optional checkCredentialsUrl, + std::optional namedFiltersUrl, + std::optional> projects, + std::optional userApiTokenUrl, + std::optional userNamedFiltersUrl, + std::optional supportAddress, + std::optional issueFilterHelp + ); + + virtual QByteArray serialize() const override; + }; + + /** + * Response when listing comments of an issue + */ + class IssueCommentListDto : public Serializable + { + public: + + /** + *

Comments in chronological order + */ + std::vector comments; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static IssueCommentListDto deserialize(const QByteArray &json); + + IssueCommentListDto( + std::vector comments + ); + + virtual QByteArray serialize() const override; + }; + + /** + * Describes an Issue Kind. + */ + class IssueKindInfoDto : public Serializable + { + public: + + /** + * Shortname for an erosion issue kind + * + *

one of ``AV``, ``CL``, ``CY``, ``DE``, ``MV``, ``SV`` + */ + QString prefix; + + /** + *

A singular string for using in UI texts about the issue kind. + */ + QString niceSingularName; + + /** + *

A plural string for using in UI texts about the issue kind. + */ + QString nicePluralName; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static IssueKindInfoDto deserialize(const QByteArray &json); + + IssueKindInfoDto( + QString prefix, + QString niceSingularName, + QString nicePluralName + ); + + IssueKindInfoDto( + IssueKind prefix, + QString niceSingularName, + QString nicePluralName + ); + + // Throws std::range_error + IssueKind getPrefixEnum() const; + + void setPrefixEnum(IssueKind newValue); + + virtual QByteArray serialize() const override; + }; + + /** + * List of Issue Tag Types + */ + class IssueTagTypeListDto : public Serializable + { + public: + + /** + *

Result when querying tags of a given issue + */ + std::vector tags; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static IssueTagTypeListDto deserialize(const QByteArray &json); + + IssueTagTypeListDto( + std::vector tags + ); + + virtual QByteArray serialize() const override; + }; + + /** + *

Describes a tainted location of a source file + */ + class LineMarkerDto : public Serializable + { + public: + + /** + * The issue kind + * + *

one of ``AV``, ``CL``, ``CY``, ``DE``, ``MV``, ``SV`` + */ + QString kind; + + /** + * The issue id. + * + *

This id is not global. It is only unique for the same project and kind. + * + *

Note, that this may not be available e.g. when served by the PluginARServer. + */ + std::optional id; + + /** + * The first tainted line. + * + *

First line in file is line 1. + */ + qint32 startLine; + + /** + * The column of the start line in which the issue starts. + * + *

First column in line is column 1. + * + *

0 iff unknown + * + * @since 7.2.0 + */ + qint32 startColumn; + + /** + * The last tainted line. + * + *

First line in file is line 1. + */ + qint32 endLine; + + /** + * The column of the end line in which the issue ends. + * + *

First column in line is column 1. + * + *

0 iff unknown + * + * @since 7.2.0 + */ + qint32 endColumn; + + /** + *

A prosaic (one-liner) description of the issue. + */ + QString description; + + /** + *

Host-relative API URI to access further information about the issue. + * + *

Note, that this may not be available e.g. when served by the PluginARServer. + */ + std::optional issueUrl; + + /** + *

Determines, whether the issue is new in the given version, i.e. it did not + * exist in the version before the given version and the given version is not + * the first analyzed version. + * + * @since 6.5.0 + */ + std::optional isNew; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static LineMarkerDto deserialize(const QByteArray &json); + + LineMarkerDto( + QString kind, + std::optional id, + qint32 startLine, + qint32 startColumn, + qint32 endLine, + qint32 endColumn, + QString description, + std::optional issueUrl, + std::optional isNew + ); + + LineMarkerDto( + IssueKind kind, + std::optional id, + qint32 startLine, + qint32 startColumn, + qint32 endLine, + qint32 endColumn, + QString description, + std::optional issueUrl, + std::optional isNew + ); + + // Throws std::range_error + IssueKind getKindEnum() const; + + void setKindEnum(IssueKind newValue); + + virtual QByteArray serialize() const override; + }; + + /** + * A log message with an associated log level + * + *

Contains messages returned from the VCS-adapters reporting on + * the VCS update result. + */ + class RepositoryUpdateMessageDto : public Serializable + { + public: + + /** + * The log-level of a message + * + *

The log-level of the message. + */ + std::optional severity; + + /** + *

the log-message. It may contain new-lines. + */ + std::optional message; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static RepositoryUpdateMessageDto deserialize(const QByteArray &json); + + RepositoryUpdateMessageDto( + std::optional severity, + std::optional message + ); + + RepositoryUpdateMessageDto( + std::optional severity, + std::optional message + ); + + // Throws std::range_error + std::optional getSeverityEnum() const; + + void setSeverityEnum(std::optional newValue); + + virtual QByteArray serialize() const override; + }; + + /** + * Contains a list of rules + * + * @since 6.5.0 + */ + class RuleListDto : public Serializable + { + public: + + + std::vector rules; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static RuleListDto deserialize(const QByteArray &json); + + RuleListDto( + std::vector rules + ); + + virtual QByteArray serialize() const override; + }; + + /** + * A Column Key + Sort Direction to indicate table sort preferences. + */ + class SortInfoDto : public Serializable + { + public: + + /** + *

The :ref:`column key<issue-table-columns>` + */ + QString key; + + /** + * A sorting direction + * + *

The sort direction associated with this column. + */ + QString direction; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static SortInfoDto deserialize(const QByteArray &json); + + SortInfoDto( + QString key, + QString direction + ); + + SortInfoDto( + QString key, + SortDirection direction + ); + + // Throws std::range_error + SortDirection getDirectionEnum() const; + + void setDirectionEnum(SortDirection newValue); + + virtual QByteArray serialize() const override; + }; + + /** + * Information about a user + */ + class UserRefDto : public Serializable + { + public: + + /** + *

User name. Use this to refer to the same user. + */ + QString name; + + /** + *

Use this for display of the user in a UI. + */ + QString displayName; + + /** + * User Type + * + *

User Type + * + * @since 7.1.0 + */ + std::optional type; + + /** + *

Whether this user is a so-called `public` user. + * + * @since 7.1.0 + */ + std::optional isPublic; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static UserRefDto deserialize(const QByteArray &json); + + UserRefDto( + QString name, + QString displayName, + std::optional type, + std::optional isPublic + ); + + UserRefDto( + QString name, + QString displayName, + std::optional type, + std::optional isPublic + ); + + // Throws std::range_error + std::optional getTypeEnum() const; + + void setTypeEnum(std::optional newValue); + + virtual QByteArray serialize() const override; + }; + + /** + * Contains a list of analyzed file descriptions. + */ + class AnalyzedFileListDto : public Serializable + { + public: + + /** + * Describes the version of analysis data of a certain Project. + * + *

The version this list was queried with. + */ + AnalysisVersionDto version; + + + std::vector rows; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static AnalyzedFileListDto deserialize(const QByteArray &json); + + AnalyzedFileListDto( + AnalysisVersionDto version, + std::vector rows + ); + + virtual QByteArray serialize() const override; + }; + + /** + * Contains a list of entities and the version of their versioned aspects + */ + class EntityListDto : public Serializable + { + public: + + /** + * Describes the version of analysis data of a certain Project. + * + *

The version this entity list was queried with. + */ + std::optional version; + + + std::vector entities; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static EntityListDto deserialize(const QByteArray &json); + + EntityListDto( + std::optional version, + std::vector entities + ); + + virtual QByteArray serialize() const override; + }; + + /** + *

Describes information that can be used to display a file with erosion information. + * + * @since 6.2.0 + */ + class FileViewDto : public Serializable + { + public: + + /** + *

The complete path of the file relative to the projects file-root + */ + QString fileName; + + /** + *

ISO-8601 Datestring of the file's version that can be used when manually + * constructing an URL to retrieve the file's source-code. + * + *

The format used is yyyy-MM-ddTHH:mm:ss.SSSZZ + * + * @since 6.4.2 + */ + std::optional version; + + /** + *

Refers to the source code which can be gotten as text/plain or as an + * application/json object containing a token-sequence + * + *

Note, that this may not be available e.g. when served by the PluginARServer. + */ + std::optional sourceCodeUrl; + + /** + *

The erosion information associated with the file + */ + std::vector lineMarkers; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static FileViewDto deserialize(const QByteArray &json); + + FileViewDto( + QString fileName, + std::optional version, + std::optional sourceCodeUrl, + std::vector lineMarkers + ); + + virtual QByteArray serialize() const override; + }; + + /** + *

Describes an issue + */ + class IssueDto : public Serializable + { + public: + + /** + * The issue kind + * + *

one of ``AV``, ``CL``, ``CY``, ``DE``, ``MV``, ``SV`` + */ + QString kind; + + /** + * The issue id + * + *

This id is not global. It is only unique for the same project and kind. + */ + qint64 id; + + /** + * The Project the issue belongs to + */ + ProjectReferenceDto parentProject; + + /** + * Source locations associated with the issue + */ + std::vector sourceLocations; + + /** + * The issue kind + */ + IssueKindInfoDto issueKind; + + /** + * Whether or not the issue is hidden + * + * @since 6.4.0 + */ + bool isHidden; + + /** + *

Versioned host relative URL to view issue in browser + * + * @since 7.2.1 + */ + std::optional issueViewUrl; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static IssueDto deserialize(const QByteArray &json); + + IssueDto( + QString kind, + qint64 id, + ProjectReferenceDto parentProject, + std::vector sourceLocations, + IssueKindInfoDto issueKind, + bool isHidden, + std::optional issueViewUrl + ); + + IssueDto( + IssueKind kind, + qint64 id, + ProjectReferenceDto parentProject, + std::vector sourceLocations, + IssueKindInfoDto issueKind, + bool isHidden, + std::optional issueViewUrl + ); + + // Throws std::range_error + IssueKind getKindEnum() const; + + void setKindEnum(IssueKind newValue); + + virtual QByteArray serialize() const override; + }; + + /** + * Result of querying the issue-list retrieval entry point mainly + * containing a list of issues. + */ + class IssueTableDto : public Serializable + { + public: + + /** + * Describes the version of analysis data of a certain Project. + * + *

The version of the ``removed`` issues. + * + *

If the query was not an actual diff query this will be unset. + */ + std::optional startVersion; + + /** + * Describes the version of analysis data of a certain Project. + * + *

The version of the ``added`` issues for a diff query + * or simply the version of a normal issue list query (no startVersion) + */ + AnalysisVersionDto endVersion; + + /** + *

Url to view the issues in the Dashboard Browser UI + * + * @since 7.2.1 + */ + std::optional tableViewUrl; + + /** + *

The Issue Table Columns describing the issue fields. + * + *

Deprecated since 7.1.0. Use :json:object`TableInfo` instead + * + * @deprecated + */ + std::optional> columns; + + /** + *

The actual issue data objects. + * + *

The issue object contents are dynamic and depend on the queried + * issue kind. See :ref:`here<issue-table-columns>` for the individual field + * descriptions depending on the issue kind. The values need to be interpreted + * according to their columntype. + * + *

This only contains a subset of the complete data if paging is enabled via + * ``offset`` and ``limit``. + */ + std::vector> rows; + + /** + *

The total number of issues. + * + *

Only available when ``computeTotalRowCount`` was specified as ``true``. + * Mostly useful when doing paged queries using the query parameters ``limit`` + * and ``offset``. + */ + std::optional totalRowCount; + + /** + *

The total number of issues existing in the ``current`` version and not in + * the ``baseline`` version. + * + *

Only useful in diff queries and only calculated when + * ``computeTotalRowCount`` was specified as ``true``. + */ + std::optional totalAddedCount; + + /** + *

The total number of issues existing in the ``baseline`` version and not in + * the ``current`` version. + * + *

Only useful in diff queries and only calculated when + * ``computeTotalRowCount`` was specified as ``true``. + */ + std::optional totalRemovedCount; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static IssueTableDto deserialize(const QByteArray &json); + + IssueTableDto( + std::optional startVersion, + AnalysisVersionDto endVersion, + std::optional tableViewUrl, + std::optional> columns, + std::vector> rows, + std::optional totalRowCount, + std::optional totalAddedCount, + std::optional totalRemovedCount + ); + + virtual QByteArray serialize() const override; + }; + + /** + * Contains a list of metric descriptions + */ + class MetricListDto : public Serializable + { + public: + + /** + * Describes the version of analysis data of a certain Project. + * + *

The version this metric list was queried with. + */ + std::optional version; + + + std::vector metrics; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static MetricListDto deserialize(const QByteArray &json); + + MetricListDto( + std::optional version, + std::vector metrics + ); + + virtual QByteArray serialize() const override; + }; + + /** + * The result of a metric values query + */ + class MetricValueRangeDto : public Serializable + { + public: + + /** + * Describes the version of analysis data of a certain Project. + * + *

The start version of the metric value range. + */ + AnalysisVersionDto startVersion; + + /** + * Describes the version of analysis data of a certain Project. + * + *

The end version of the metric value range. + */ + AnalysisVersionDto endVersion; + + /** + *

The id of the entity + */ + QString entity; + + /** + *

The id of the metric + */ + QString metric; + + /** + *

An array with the metric values. + * + *

The array size is ``endVersion.index - startVersion.index + 1``. + * Its values are numbers or ``null`` if no value is available. + * They correspond to the range defined by ``startVersion`` and ``endVersion``. + */ + std::vector> values; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static MetricValueRangeDto deserialize(const QByteArray &json); + + MetricValueRangeDto( + AnalysisVersionDto startVersion, + AnalysisVersionDto endVersion, + QString entity, + QString metric, + std::vector> values + ); + + virtual QByteArray serialize() const override; + }; + + /** + * The result of a metric value table query + */ + class MetricValueTableDto : public Serializable + { + public: + + /** + *

The column descriptions of the entity columns. + * + *

Only contains the two fields ``key`` and ``header``. + */ + std::vector columns; + + /** + *

The entity data. + */ + std::vector rows; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static MetricValueTableDto deserialize(const QByteArray &json); + + MetricValueTableDto( + std::vector columns, + std::vector rows + ); + + virtual QByteArray serialize() const override; + }; + + /** + * Named Filter Creation Request Data + * + *

Contains information to create a named filter from scratch + * + * @since 7.3.0 + */ + class NamedFilterCreateDto : public Serializable + { + public: + + + QString displayName; + + /** + * IssueKind for Named-Filter creation + * + *

one of ``AV``, ``CL``, ``CY``, ``DE``, ``MV``, ``SV``, ``UNIVERSAL`` + */ + QString kind; + + /** + *

The actual filters with column-id as key and filter-value as value + * + *

* Possible keys are described here :ref:`column keys<issue-table-columns>` + * * This does not necessarily contain an entry for every column. In fact it may even be empty. + * * A filter value can never be null. + * * May contain references to columns that do not exist in the table column configuration. + */ + std::map filters; + + /** + *

Defines the sort order to apply. + * + *

* The first entry has the highest sort priority and the last one the lowest. + * * No column key may be referenced twice. + * * May contain references to columns that do not exist in the table column configuration. + */ + std::vector sorters; + + /** + * NamedFilter visibility configuration + * + *

Only applicable for global named filters. + * + *

You may not have access to this information depending on your permissions. + * + * @since 7.3.0 + */ + std::optional visibility; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static NamedFilterCreateDto deserialize(const QByteArray &json); + + NamedFilterCreateDto( + QString displayName, + QString kind, + std::map filters, + std::vector sorters, + std::optional visibility + ); + + NamedFilterCreateDto( + QString displayName, + IssueKindForNamedFilterCreation kind, + std::map filters, + std::vector sorters, + std::optional visibility + ); + + // Throws std::range_error + IssueKindForNamedFilterCreation getKindEnum() const; + + void setKindEnum(IssueKindForNamedFilterCreation newValue); + + virtual QByteArray serialize() const override; + }; + + /** + * A Named Filter configuration. + * + *

It can consist of the following: + * - Filter values for the individual columns and the path-filter + * - A sort configuration indicating how to sort the table columns + * + * @since 6.9.0 + */ + class NamedFilterInfoDto : public Serializable + { + public: + + /** + *

Uniquely identifies this filter configuration. + */ + QString key; + + /** + *

The name to use when displaying this filter. + */ + QString displayName; + + /** + *

The URL for getting/updating/deleting this named filter. + * + * @since 7.3.0 + */ + std::optional url; + + /** + *

Whether this filter is a predefined filter. + */ + bool isPredefined; + + /** + * A named filter type + * + *

* `PREDEFINED` - Named filters of this type are immutable and exist out of the box and can be used by everyone + * * `GLOBAL` - Named filters of this type are usable by everyone and managed by the so called filter managers + * * `CUSTOM` - Named filters of this type are creatable by everyone but only visible to their owner + * + * @since 7.3.0 + */ + std::optional type; + + /** + *

Whether the user that requested this object can change or delete this filter configuration + */ + bool canWrite; + + /** + *

The actual filters with column-id as key and filter-value as value + * + *

* Possible keys are described here :ref:`column keys<issue-table-columns>` + * * This does not necessarily contain an entry for every column. In fact it may even be empty. + * * A filter value can never be null. + * * May contain references to columns that do not exist in the table column configuration. + */ + std::map filters; + + /** + *

Defines the sort order to apply. + * + *

* The first entry has the highest sort priority and the last one the lowest. + * * No column key may be referenced twice. + * * May contain references to columns that do not exist in the table column configuration. + */ + std::optional> sorters; + + /** + *

True if this filter is valid for all issue kinds, false otherwise. + */ + bool supportsAllIssueKinds; + + /** + *

Supported Issue Kinds. + * + *

If ``supportsAllIssueKinds`` is false, then this set indicates, which issue kinds are supported. + */ + std::optional> issueKindRestrictions; + + /** + * NamedFilter visibility configuration + * + *

Only applicable for global named filters. + * + *

You may not have access to this information depending on your permissions. + * + * @since 7.3.0 + */ + std::optional visibility; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static NamedFilterInfoDto deserialize(const QByteArray &json); + + NamedFilterInfoDto( + QString key, + QString displayName, + std::optional url, + bool isPredefined, + std::optional type, + bool canWrite, + std::map filters, + std::optional> sorters, + bool supportsAllIssueKinds, + std::optional> issueKindRestrictions, + std::optional visibility + ); + + NamedFilterInfoDto( + QString key, + QString displayName, + std::optional url, + bool isPredefined, + std::optional type, + bool canWrite, + std::map filters, + std::optional> sorters, + bool supportsAllIssueKinds, + std::optional> issueKindRestrictions, + std::optional visibility + ); + + // Throws std::range_error + std::optional getTypeEnum() const; + + void setTypeEnum(std::optional newValue); + + virtual QByteArray serialize() const override; + }; + + /** + * Named Filter Update Request Data + * + *

Contains information to update an existing named filter. + * Fields that are not given, won't be touched. + * + * @since 7.3.0 + */ + class NamedFilterUpdateDto : public Serializable + { + public: + + /** + *

An optional new name for the named filter. + * + *

Changing this will also result in a changed ID and URL. + */ + std::optional name; + + /** + *

The actual filters with column-id as key and filter-value as value + * + *

* Possible keys are described here :ref:`column keys<issue-table-columns>` + * * This does not necessarily contain an entry for every column. In fact it may even be empty. + * * A filter value can never be null. + * * May contain references to columns that do not exist in the table column configuration. + */ + std::optional> filters; + + /** + *

Defines the sort order to apply. + * + *

* The first entry has the highest sort priority and the last one the lowest. + * * No column key may be referenced twice. + * * May contain references to columns that do not exist in the table column configuration. + */ + std::optional> sorters; + + /** + * NamedFilter visibility configuration + * + *

Only applicable for global named filters. + * + *

You may not have access to this information depending on your permissions. + * + * @since 7.3.0 + */ + std::optional visibility; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static NamedFilterUpdateDto deserialize(const QByteArray &json); + + NamedFilterUpdateDto( + std::optional name, + std::optional> filters, + std::optional> sorters, + std::optional visibility + ); + + virtual QByteArray serialize() const override; + }; + + /** + * Information about a project + */ + class ProjectInfoDto : public Serializable + { + public: + + /** + *

The name of the project. Use this string to refer to the project. + */ + QString name; + + /** + *

A host-relative URL that can be used to display filter-help meant for humans. + * + * @since 6.5.0 + */ + std::optional issueFilterHelp; + + /** + *

URL to query the table meta data (column definitions). Needs the issue kind as a query parameter ``kind``. + * + * @since 6.9.0 + */ + std::optional tableMetaUri; + + /** + *

List of users associated with the project and visible to the authenticated user. + */ + std::vector users; + + /** + *

List of analysis versions associated with the project. + */ + std::vector versions; + + /** + *

List of IssueKinds associated with the project. + */ + std::vector issueKinds; + + /** + *

Whether or not the project has hidden issues. When this is false then UI should try to hide all the complexity related with hidden issues. + */ + bool hasHiddenIssues; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static ProjectInfoDto deserialize(const QByteArray &json); + + ProjectInfoDto( + QString name, + std::optional issueFilterHelp, + std::optional tableMetaUri, + std::vector users, + std::vector versions, + std::vector issueKinds, + bool hasHiddenIssues + ); + + virtual QByteArray serialize() const override; + }; + + /** + * Response to Repository Update Request + * + *

Contains messages returned from the VCS-adapters reporting on + * the VCS update result. + */ + class RepositoryUpdateResponseDto : public Serializable + { + public: + + /** + *

The messages returned from the VCS-adapters + */ + std::vector messages; + + /** + *

Whether at least one of the messages is at least an ERROR + */ + bool hasErrors; + + /** + *

Whether at least one of the messages is at least a WARNING + */ + bool hasWarnings; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static RepositoryUpdateResponseDto deserialize(const QByteArray &json); + + RepositoryUpdateResponseDto( + std::vector messages, + bool hasErrors, + bool hasWarnings + ); + + virtual QByteArray serialize() const override; + }; + + /** + * Contains meta information for issuelist querying of a specific issue kind. + * + * @since 6.9.0 + */ + class TableInfoDto : public Serializable + { + public: + + /** + *

Host-relative URL to query the rows of the issue table. + * + *

Needs get parameters to specify which data is requested exactly. + */ + QString tableDataUri; + + /** + *

Host-relative URL base to view an issue in the dashboard. + * + *

In order to construct the issue URL it is necessary to append the issue-id (e.g. SV123) + * to the URL path. Also the query-parameter is not part of the URL base and can be added. + * + * @since 7.2.1 + */ + std::optional issueBaseViewUri; + + /** + *

Columns with detailed information on how to create a table to display the data. + */ + std::vector columns; + + /** + *

The ``Named Filters`` available for the chosen issue kind. + * + *

This will contain predefined and custom filter configurations and never be empty. + * + *

The list order is a recommendation for UI display. + */ + std::vector filters; + + /** + *

The key of the configured default filter. + * + *

This will not be given if the configured default is not also visible + * to the requesting user. + */ + std::optional userDefaultFilter; + + /** + *

The key of the factory default filter. + * + *

This will always point to an existing and visible named filter. + */ + QString axivionDefaultFilter; + + // Throws Axivion::Internal::Dto::invalid_dto_exception + static TableInfoDto deserialize(const QByteArray &json); + + TableInfoDto( + QString tableDataUri, + std::optional issueBaseViewUri, + std::vector columns, + std::vector filters, + std::optional userDefaultFilter, + QString axivionDefaultFilter + ); + + virtual QByteArray serialize() const override; + }; + +}