Compare commits
No commits in common. "1e7694df63e3974e5daca60c8d051db6b81bf8e6" and "d7f83d4b46552b0d9729cf83212fdf12e389a6c7" have entirely different histories.
1e7694df63
...
d7f83d4b46
@ -51,7 +51,14 @@ void build::parse_json(const std::string& json_data) {
|
|||||||
{"can_be_cancelled", [this](const nlohmann::json& val) { can_be_cancelled = val.get<bool>(); }},
|
{"can_be_cancelled", [this](const nlohmann::json& val) { can_be_cancelled = val.get<bool>(); }},
|
||||||
{"can_be_retried", [this](const nlohmann::json& val) { can_be_retried = val.get<bool>(); }},
|
{"can_be_retried", [this](const nlohmann::json& val) { can_be_retried = val.get<bool>(); }},
|
||||||
{"title", [this](const nlohmann::json& val) { title = val.get<std::string>(); }},
|
{"title", [this](const nlohmann::json& val) { title = val.get<std::string>(); }},
|
||||||
{"self_link", [this](const nlohmann::json& val) { self_link = val.get<std::string>(); }},
|
{"self_link", [this](const nlohmann::json& val) {
|
||||||
|
self_link = val.get<std::string>();
|
||||||
|
std::regex rgx("/builds/(\\d+)");
|
||||||
|
std::smatch match;
|
||||||
|
if (std::regex_search(self_link, match, rgx)) {
|
||||||
|
id = std::stol(match[1]);
|
||||||
|
}
|
||||||
|
}},
|
||||||
{"build_log_url", [this](const nlohmann::json& val) { build_log_url = val.get<std::string>(); }},
|
{"build_log_url", [this](const nlohmann::json& val) { build_log_url = val.get<std::string>(); }},
|
||||||
{"upload_log_url", [this](const nlohmann::json& val) { upload_log_url = val.get<std::string>(); }},
|
{"upload_log_url", [this](const nlohmann::json& val) { upload_log_url = val.get<std::string>(); }},
|
||||||
{"duration", [this](const nlohmann::json& val) { duration = val.get<std::string>(); }},
|
{"duration", [this](const nlohmann::json& val) { duration = val.get<std::string>(); }},
|
||||||
|
@ -214,7 +214,7 @@ std::string launchpad::build_full_url(const std::string& endpoint) const {
|
|||||||
} else if (endpoint != "") {
|
} else if (endpoint != "") {
|
||||||
return service_root + "/" + api_version + "/" + endpoint;
|
return service_root + "/" + api_version + "/" + endpoint;
|
||||||
}
|
}
|
||||||
std::cerr << "Internal error: endpoint is empty" << std::endl;
|
std::cerr << "endpoint is empty" << std::endl;
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user