73 lines
1.9 KiB
C++
73 lines
1.9 KiB
C++
|
#pragma once
|
||
|
/*
|
||
|
* Copyright (C) 2024 Dominik Meyer
|
||
|
*
|
||
|
* This program is free software: you can redistribute it and/or modify
|
||
|
* it under the terms of the GNU General Public License as published by
|
||
|
* the Free Software Foundation, either version 3 of the License, or
|
||
|
* (at your option) any later version.
|
||
|
*
|
||
|
* This program is distributed in the hope that it will be useful,
|
||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
|
* GNU General Public License for more details.
|
||
|
*
|
||
|
* You should have received a copy of the GNU General Public License
|
||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||
|
*/
|
||
|
|
||
|
#include "nlohmann/json_fwd.hpp"
|
||
|
#include <cstdint>
|
||
|
#include <nlohmann/json.hpp>
|
||
|
#include <Redmine/Object.hpp>
|
||
|
#include <string>
|
||
|
|
||
|
/**
|
||
|
* @brief The main namespace of this library for Redmine related datatypes, classes, and functions
|
||
|
*
|
||
|
*/
|
||
|
namespace Redmine
|
||
|
{
|
||
|
|
||
|
/**
|
||
|
* @brief This class represents a user within the redmine server.
|
||
|
*
|
||
|
*/
|
||
|
class Issue : public Redmine::Object
|
||
|
{
|
||
|
private:
|
||
|
/// the data store for the issue
|
||
|
nlohmann::json data_;
|
||
|
|
||
|
/**
|
||
|
* @brief verify issue data
|
||
|
*
|
||
|
* @param data - the json object containing the issue data
|
||
|
*/
|
||
|
void _verify(const nlohmann::json &data);
|
||
|
|
||
|
public:
|
||
|
explicit Issue(const nlohmann::json &issue);
|
||
|
|
||
|
/**
|
||
|
* @brief set the issue object from a json object
|
||
|
*
|
||
|
* @param data
|
||
|
*/
|
||
|
void set(const nlohmann::json &data);
|
||
|
|
||
|
/**
|
||
|
* @brief return a json object from the issue object
|
||
|
*
|
||
|
* @return nlohmann::json
|
||
|
*/
|
||
|
nlohmann::json get() const;
|
||
|
|
||
|
|
||
|
std::uint64_t getId() const;
|
||
|
|
||
|
|
||
|
|
||
|
}; // class Issue
|
||
|
|
||
|
}; // namespace Redmine
|