This commit is contained in:
Simon Quigley 2024-12-16 21:46:36 -06:00
parent 374da51607
commit c5461e734e
4 changed files with 6 additions and 1 deletions

View File

@ -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<source_package_publishing_history> 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());

View File

@ -125,6 +125,7 @@ bool build::cancel() {
if (self_link.empty()) return false;
std::map<std::string, std::string> 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();
}

View File

@ -211,7 +211,7 @@ bool launchpad::is_authenticated() const {
std::string launchpad::build_full_url(const std::string& endpoint) const {
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;

View File

@ -59,6 +59,7 @@ std::generator<build> source_package_publishing_history::getBuilds() const {
if (self_link.empty()) { co_return; }
std::map<std::string, std::string> 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; }