// Copyright (C) 2024 Simon Quigley // // 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 . #ifndef SOURCE_PACKAGE_PUBLISHING_HISTORY #define SOURCE_PACKAGE_PUBLISHING_HISTORY #include #include #include #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 parse(const std::string& json_data); void parse_json(const std::string& json_data); std::generator getBuilds() const; lazy_optional()>> distro_series; std::generator 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 _distro_series = std::nullopt; }; #endif // SOURCE_PACKAGE_PUBLISHING_HISTORY