diff --git a/src/archive.cpp b/src/archive.cpp index c2894fe..491cb4d 100644 --- a/src/archive.cpp +++ b/src/archive.cpp @@ -110,6 +110,8 @@ void archive::parse_json(const std::string& json_data) { } } + std::cout << "!!!!!! " << self_link << std::endl; + std::string link = owner_link; size_t pos = link.find("~"); if (pos != std::string::npos) { @@ -187,6 +189,7 @@ std::generator archive::getPublishedSources( } } + std::cout << "Running a getPublishedSources() operation with " << self_link << "..." << std::endl; auto response = lp->api_get(self_link, params); if(!response) co_return; auto data = nlohmann::json::parse(response.value()); diff --git a/src/build.cpp b/src/build.cpp index 71ee646..448ad92 100644 --- a/src/build.cpp +++ b/src/build.cpp @@ -125,6 +125,7 @@ bool build::cancel() { if (self_link.empty()) return false; std::map params; params["ws.op"] = "cancel"; + std::cout << "Running a cancel operation..." << std::endl; auto response = lp->api_post(self_link, params); return response.has_value(); } diff --git a/src/launchpad.cpp b/src/launchpad.cpp index 1eaaaa8..f71e731 100644 --- a/src/launchpad.cpp +++ b/src/launchpad.cpp @@ -209,16 +209,18 @@ bool launchpad::is_authenticated() const { } std::string launchpad::build_full_url(const std::string& endpoint) const { + std::cout << "....!!!!!!!!!!!!! " << endpoint << std::endl; if (endpoint.rfind("http", 0) == 0) { return endpoint; - } else if (endpoint != "") { + } else if (!endpoint.empty()) { return service_root + "/" + api_version + "/" + endpoint; } std::cerr << "Internal error: endpoint is empty" << std::endl; return ""; } -std::optional launchpad::api_get(const std::string& endpoint, const std::map& params) const { +std::optional launchpad::api_get(const std::string endpoint, const std::map params) const { + std::cout << "!!!!!!!!!!!!! " << endpoint << std::endl; std::string url = build_full_url(endpoint); if (url.empty()) { if (!params.empty()) { @@ -296,10 +298,10 @@ std::optional launchpad::api_get(const std::string& endpoint, const } std::optional launchpad::api_post( - const std::string& endpoint, - const std::map& params, + const std::string endpoint, + const std::map params, bool build_endpoint, - const std::string& token_secret_override + const std::string token_secret_override ) { if (endpoint.empty()) { if (!params.empty()) { diff --git a/src/launchpad.h b/src/launchpad.h index 8791b6c..d842633 100644 --- a/src/launchpad.h +++ b/src/launchpad.h @@ -69,11 +69,11 @@ public: // API Methods std::optional get_archive(const std::string& distribution_name); - std::optional api_get(const std::string& endpoint = "", const std::map& params = {}) const; - std::optional api_post(const std::string& endpoint = "", - const std::map& params = {}, + std::optional api_get(const std::string endpoint = "", const std::map params = {}) const; + std::optional api_post(const std::string endpoint = "", + const std::map params = {}, bool build_endpoint = true, - const std::string& token_secret_override = ""); + const std::string token_secret_override = ""); std::optional api_patch(const std::string& endpoint = "", const nlohmann::json& data = nlohmann::json{}); std::optional api_delete(const std::string& endpoint = ""); diff --git a/src/source_package_publishing_history.cpp b/src/source_package_publishing_history.cpp index 3171e2a..deba3bc 100644 --- a/src/source_package_publishing_history.cpp +++ b/src/source_package_publishing_history.cpp @@ -59,6 +59,7 @@ std::generator source_package_publishing_history::getBuilds() const { if (self_link.empty()) { co_return; } std::map params = {{"ws.op", "getBuilds"}}; + std::cout << "Running a getBuilds() operation..." << std::endl; auto response = lp->api_get(self_link, params); if (!response.has_value()) { co_return; } @@ -66,7 +67,6 @@ std::generator source_package_publishing_history::getBuilds() const { auto data = nlohmann::json::parse(response.value()); if (data.contains("entries") && data["entries"].is_array()) { for (auto& entry : data["entries"]) { - auto b_opt = build::parse(entry.dump()); if(!b_opt.has_value()) continue; b_opt->set_lp(lp); co_yield b_opt.value();