launchpadlib-cpp/src/source_package_publishing_history.h

65 lines
2.1 KiB
C++

// Copyright (C) 2024 Simon Quigley <tsimonq2@ubuntu.com>
//
// 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/>.
#ifndef SOURCE_PACKAGE_PUBLISHING_HISTORY
#define SOURCE_PACKAGE_PUBLISHING_HISTORY
#include <string>
#include <optional>
#include <generator>
#include "distro_series.h"
#include "lazy_optional.h"
class launchpad;
class build;
class binary_package_publishing_history;
#ifndef LAUNCHPAD_API
#ifdef BUILDING_LAUNCHPAD
#define LAUNCHPAD_API __attribute__((visibility("default")))
#else
#define LAUNCHPAD_API
#endif
#endif
class LAUNCHPAD_API source_package_publishing_history {
public:
source_package_publishing_history();
~source_package_publishing_history();
static std::optional<source_package_publishing_history> parse(const std::string& json_data);
void parse_json(const std::string& json_data);
std::generator<build> getBuilds() const;
lazy_optional<class distro_series, std::function<std::optional<class distro_series>()>> distro_series;
std::generator<binary_package_publishing_history> getPublishedBinaries(bool active_binaries_only = false) const;
bool requestDeletion(const std::string& removal_comment = "");
std::string display_name;
std::string distro_series_link;
std::string self_link;
std::string source_package_name;
std::string source_package_version;
void set_lp(launchpad* lp_ptr);
private:
launchpad* lp;
std::optional<class distro_series> _distro_series = std::nullopt;
};
#endif // SOURCE_PACKAGE_PUBLISHING_HISTORY