All checks were successful
continuous-integration/drone/push Build is passing
64 lines
1.8 KiB
C++
64 lines
1.8 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/>.
|
|
*/
|
|
|
|
/**
|
|
* @brief The main namespace of this library for Redmine related datatypes, classes, and functions
|
|
*
|
|
*/
|
|
#include <cstdint>
|
|
#include <string>
|
|
#include <vector>
|
|
namespace Redmine
|
|
{
|
|
/**
|
|
* @brief Class for filering data in a Redmine API query
|
|
*
|
|
*/
|
|
class Filter
|
|
{
|
|
private:
|
|
|
|
/// filter the issued by project id
|
|
bool filterByProjectID_;
|
|
/// the project ID to filter
|
|
std::uint64_t projectID_;
|
|
|
|
/// possible project stati for a filter
|
|
enum class ProjectStatus {open, closed, both};
|
|
|
|
/// the project status to filter by
|
|
ProjectStatus projectStatus_;
|
|
|
|
/// whether to filter by assigned user or not
|
|
bool filterByAssignedUser_;
|
|
|
|
/// the user ID to filter by
|
|
std::uint64_t assignedUserID_;
|
|
|
|
public:
|
|
|
|
Filter();
|
|
|
|
void filterByProjectID(const std::uint64_t id);
|
|
void setProjectStatus(const ProjectStatus& status);
|
|
void filterByAssignedUserId(const std::uint64_t id);
|
|
std::string toQueryString() const;
|
|
|
|
};
|
|
|
|
}; // namespace Redmine
|