|
|
|
@ -68,6 +68,24 @@ void distribution::parse_json(const std::string& json_data) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::optional<distro_series> distribution::getSeries(const std::string& name_or_version) {
|
|
|
|
|
std::map<std::string, std::string> params = {
|
|
|
|
|
{"name_or_version", name_or_version},
|
|
|
|
|
{"ws.op", "getSeries"}
|
|
|
|
|
};
|
|
|
|
|
auto response = lp->api_get(self_link, params);
|
|
|
|
|
if (!response.has_value()) {
|
|
|
|
|
return std::nullopt;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::optional<distro_series> ds_opt = distro_series::parse(response.value());
|
|
|
|
|
if (!ds_opt.has_value()) return std::nullopt;
|
|
|
|
|
|
|
|
|
|
// Set lp in the returned archive
|
|
|
|
|
ds_opt->set_lp(lp);
|
|
|
|
|
return ds_opt;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void distribution::set_lp(launchpad* lp_ptr) {
|
|
|
|
|
lp = lp_ptr;
|
|
|
|
|
}
|
|
|
|
|