launchpadlib-cpp/src/distro_series.h

136 lines
6.4 KiB
C++

#ifndef DISTRO_SERIES_H
#define DISTRO_SERIES_H
#include <string>
#include <optional>
#include <nlohmann/json.hpp>
#include <generator>
#include <vector>
#ifndef LAUNCHPAD_API
#ifdef BUILDING_LAUNCHPAD
#define LAUNCHPAD_API __attribute__((visibility("default")))
#else
#define LAUNCHPAD_API
#endif
#endif
class launchpad;
class distro_series {
public:
distro_series();
~distro_series();
static std::optional<distro_series> parse(const std::string& json_data);
void parse_json(const std::string& json_data);
void set_lp(launchpad* lp_ptr);
bool active;
bool advertise_by_hash;
std::string all_milestones_collection_link;
std::string all_specifications_collection_link;
std::string architectures_collection_link;
bool backports_not_automatic;
std::string bug_reported_acknowledgement;
std::string bug_reporting_guidelines;
std::string changeslist;
std::vector<std::string> component_names;
std::string date_created;
std::string datereleased;
std::string description;
std::string displayname;
std::string distribution_link;
std::string driver_link;
std::string drivers_collection_link;
std::string fullseriesname;
std::string http_etag;
bool include_long_descriptions;
std::vector<std::string> index_compressors;
bool language_pack_full_export_requested;
std::string main_archive_link;
std::string name;
std::string nominatedarchindep_link;
std::vector<std::string> official_bug_tags;
std::string owner_link;
std::string previous_series_link;
bool proposed_not_automatic;
bool publish_by_hash;
bool publish_i18n_index;
std::string registrant_link;
std::string resource_type_link;
std::string self_link;
std::string status;
bool strict_supported_component_dependencies;
std::vector<std::string> suite_names;
std::string summary;
bool supported;
std::string title;
std::string translations_usage;
std::string valid_specifications_collection_link;
std::string version;
std::string web_link;
std::string active_milestones_collection_link;
std::string archive_mirrors_collection_link;
std::string archives_collection_link;
std::string series_collection_link;
std::string vulnerabilities_collection_link;
std::string webhooks_collection_link;
std::optional<distro_series> get() const;
bool patch(const nlohmann::json& data) const;
bool put(const nlohmann::json& data) const;
std::generator<nlohmann::json> getBuildRecords(const std::string& build_state="", const std::string& pocket="", const std::string& source_name="") const;
std::generator<distro_series> getDerivedSeries() const;
std::generator<nlohmann::json> getDifferenceComments(const std::string& since="", const std::string& source_package_name="") const;
std::generator<nlohmann::json> getDifferencesTo(const std::optional<std::string>& parent_series,
const std::optional<std::string>& difference_type,
const std::optional<std::string>& source_package_name_filter,
const std::optional<std::string>& status,
bool child_version_higher=false) const;
std::optional<nlohmann::json> getDistroArchSeries(const std::string& archtag) const;
std::generator<nlohmann::json> getPackageUploads(const std::optional<std::string>& archive=std::nullopt,
const std::optional<std::string>& created_since_date=std::nullopt,
const std::optional<std::string>& custom_type=std::nullopt,
bool exact_match=false,
const std::optional<std::string>& name=std::nullopt,
const std::optional<std::string>& pocket=std::nullopt,
const std::optional<std::string>& status=std::nullopt,
const std::optional<std::string>& version=std::nullopt) const;
std::generator<distro_series> getParentSeries() const;
std::optional<nlohmann::json> getSourcePackage(const std::string& name_) const;
std::optional<nlohmann::json> getSpecification(const std::string& name_) const;
std::optional<nlohmann::json> getSubscription(const std::string& person) const;
std::generator<nlohmann::json> getSubscriptions() const;
std::generator<nlohmann::json> getTranslationImportQueueEntries(const std::optional<std::string>& import_status=std::nullopt,
const std::optional<std::string>& file_extension=std::nullopt) const;
std::optional<nlohmann::json> getTranslationTemplateStatistics() const;
std::generator<nlohmann::json> getTranslationTemplates() const;
std::generator<nlohmann::json> searchTasks(const std::map<std::string,std::string>& params) const;
std::optional<nlohmann::json> userHasBugSubscriptions() const;
bool addBugSubscription(const std::optional<std::string>& subscriber=std::nullopt) const;
bool addBugSubscriptionFilter(const std::optional<std::string>& subscriber=std::nullopt) const;
bool initDerivedDistroSeries(const std::optional<std::string>& archindep_archtag,
const std::vector<std::string>& architectures,
const std::vector<std::string>& overlay_components,
const std::vector<std::string>& overlay_pockets,
const std::vector<std::string>& overlays,
const std::vector<std::string>& packagesets,
const std::vector<std::string>& parents,
bool rebuild=false) const;
std::optional<nlohmann::json> newMilestone(const std::string& name,
const std::optional<std::string>& code_name,
const std::optional<std::string>& date_targeted,
const std::optional<std::string>& summary) const;
bool removeBugSubscription(const std::optional<std::string>& subscriber=std::nullopt) const;
private:
launchpad* lp;
};
#endif