From f18b5ca7297369b7610e55b3281335bb7134d862 Mon Sep 17 00:00:00 2001 From: Simon Quigley Date: Mon, 16 Dec 2024 12:16:19 -0600 Subject: [PATCH] Add source_package_publishing_history::requestDeletion() --- src/source_package_publishing_history.cpp | 8 ++++++++ src/source_package_publishing_history.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/src/source_package_publishing_history.cpp b/src/source_package_publishing_history.cpp index 6b4ae3c..3171e2a 100644 --- a/src/source_package_publishing_history.cpp +++ b/src/source_package_publishing_history.cpp @@ -114,3 +114,11 @@ std::generator source_package_publishing_hist data=nlohmann::json::parse(response.value()); } } + +bool source_package_publishing_history::requestDeletion(const std::string& removal_comment) { + std::map params; + params["ws.op"] = "requestDeletion"; + params["removal_comment"] = removal_comment; + auto resp = lp->api_post(self_link, params); + return resp.has_value(); +} diff --git a/src/source_package_publishing_history.h b/src/source_package_publishing_history.h index 8bc4387..cf3c418 100644 --- a/src/source_package_publishing_history.h +++ b/src/source_package_publishing_history.h @@ -45,6 +45,8 @@ public: std::optional distro_series = getDistroSeries(); std::generator getPublishedBinaries(bool active_binaries_only = false) const; + bool requestDeletion(const std::string& removal_comment = ""); + std::string distro_series_link; std::string self_link; std::string source_package_name;