Add the build property for binary_package_publishing_history

main
Simon Quigley 6 days ago
parent e99b2ef058
commit 5d803c4345

@ -176,3 +176,15 @@ bool binary_package_publishing_history::requestDeletion(const std::optional<std:
auto resp=lp->api_post(self_link,params);
return resp.has_value();
}
const std::optional<class build> binary_package_publishing_history::getBuild() {
auto response = lp->api_get(build_link);
if (!response) return std::nullopt;
auto data = nlohmann::json::parse(response.value());
auto build = build::parse(data.dump());
if (build) {
build->set_lp(lp);
return build;
}
return std::nullopt;
}

@ -5,6 +5,7 @@
#include <optional>
#include <nlohmann/json.hpp>
#include <generator>
#include "build.h"
#ifndef LAUNCHPAD_API
#ifdef BUILDING_LAUNCHPAD
@ -69,8 +70,10 @@ public:
const std::optional<std::string>& new_priority,
const std::optional<std::string>& new_section) const;
bool requestDeletion(const std::optional<std::string>& removal_comment) const;
std::optional<class build> build = getBuild();
private:
const std::optional<class build> getBuild();
launchpad* lp;
};

@ -20,10 +20,10 @@
#include <optional>
#include <generator>
#include "distro_series.h"
#include "binary_package_publishing_history.h"
class launchpad;
class build;
class binary_package_publishing_history;
#ifndef LAUNCHPAD_API
#ifdef BUILDING_LAUNCHPAD

Loading…
Cancel
Save