aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/axivion/axivionresultparser.h
blob: d8d4a39a72c5207222b28c15c2b447bbdf75cd21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#pragma once

#include "dashboard/dto.h"

#include <utils/expected.h>

#include <QList>

namespace Axivion::Internal {

class BaseResult
{
public:
    QString error;
};

class Project : public BaseResult
{
public:
    QString name;
    QString url;
};

class DashboardInfo : public BaseResult
{
public:
    QString mainUrl;
    QList<Project> projects;
};

class ShortIssue : public BaseResult
{
public:
    QString id;
    QString state;
    QString errorNumber;
    QString message;
    QString entity;
    QString filePath;
    QString severity;
    int lineNumber = 0;
};

class IssuesList : public BaseResult
{
public:
    QList<ShortIssue> issues;
};

namespace ResultParser {

DashboardInfo parseDashboardInfo(const QByteArray &input);
Utils::expected_str<Dto::ProjectInfoDto> parseProjectInfo(const QByteArray &input);
IssuesList parseIssuesList(const QByteArray &input);
QString parseRuleInfo(const QByteArray &input);

} // ResultParser

} // Axivion::Internal