Compare commits
2 Commits
1e7694df63
...
2d2595b495
Author | SHA1 | Date | |
---|---|---|---|
2d2595b495 | |||
374da51607 |
@ -187,6 +187,7 @@ std::generator<source_package_publishing_history> archive::getPublishedSources(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::cout << "Running a getPublishedSources() operation..." << std::endl;
|
||||||
auto response = lp->api_get(self_link, params);
|
auto response = lp->api_get(self_link, params);
|
||||||
if(!response) co_return;
|
if(!response) co_return;
|
||||||
auto data = nlohmann::json::parse(response.value());
|
auto data = nlohmann::json::parse(response.value());
|
||||||
|
@ -125,6 +125,7 @@ bool build::cancel() {
|
|||||||
if (self_link.empty()) return false;
|
if (self_link.empty()) return false;
|
||||||
std::map<std::string, std::string> params;
|
std::map<std::string, std::string> params;
|
||||||
params["ws.op"] = "cancel";
|
params["ws.op"] = "cancel";
|
||||||
|
std::cout << "Running a cancel operation..." << std::endl;
|
||||||
auto response = lp->api_post(self_link, params);
|
auto response = lp->api_post(self_link, params);
|
||||||
return response.has_value();
|
return response.has_value();
|
||||||
}
|
}
|
||||||
|
@ -221,8 +221,8 @@ std::string launchpad::build_full_url(const std::string& endpoint) const {
|
|||||||
std::optional<std::string> launchpad::api_get(const std::string& endpoint, const std::map<std::string, std::string>& params) const {
|
std::optional<std::string> launchpad::api_get(const std::string& endpoint, const std::map<std::string, std::string>& params) const {
|
||||||
std::string url = build_full_url(endpoint);
|
std::string url = build_full_url(endpoint);
|
||||||
if (url.empty()) {
|
if (url.empty()) {
|
||||||
std::cerr << "Internal error: please include the following info in a bug report:" << std::endl;
|
|
||||||
if (!params.empty()) {
|
if (!params.empty()) {
|
||||||
|
std::cerr << "Internal error: please include the following info in a bug report:" << std::endl;
|
||||||
for (const auto& [key, value] : params) {
|
for (const auto& [key, value] : params) {
|
||||||
std::cerr << url_encode(key) + "=" + url_encode(value) + "&";
|
std::cerr << url_encode(key) + "=" + url_encode(value) + "&";
|
||||||
}
|
}
|
||||||
@ -302,8 +302,8 @@ std::optional<std::string> launchpad::api_post(
|
|||||||
const std::string& token_secret_override
|
const std::string& token_secret_override
|
||||||
) {
|
) {
|
||||||
if (endpoint.empty()) {
|
if (endpoint.empty()) {
|
||||||
std::cerr << "Internal error: please include the following info in a bug report:" << std::endl;
|
|
||||||
if (!params.empty()) {
|
if (!params.empty()) {
|
||||||
|
std::cerr << "Internal error: please include the following info in a bug report:" << std::endl;
|
||||||
for (const auto& [key, value] : params) {
|
for (const auto& [key, value] : params) {
|
||||||
std::cerr << url_encode(key) + "=" + url_encode(value) + "&";
|
std::cerr << url_encode(key) + "=" + url_encode(value) + "&";
|
||||||
}
|
}
|
||||||
|
@ -59,6 +59,7 @@ std::generator<build> source_package_publishing_history::getBuilds() const {
|
|||||||
if (self_link.empty()) { co_return; }
|
if (self_link.empty()) { co_return; }
|
||||||
|
|
||||||
std::map<std::string, std::string> params = {{"ws.op", "getBuilds"}};
|
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);
|
auto response = lp->api_get(self_link, params);
|
||||||
if (!response.has_value()) { co_return; }
|
if (!response.has_value()) { co_return; }
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user