|
|
|
// Copyright (C) 2024 Simon Quigley <tsimonq2@ubuntu.com>
|
|
|
|
//
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
#ifndef ARCHIVE_H
|
|
|
|
#define ARCHIVE_H
|
|
|
|
|
|
|
|
#include "source_package_publishing_history.h"
|
|
|
|
#include <generator>
|
|
|
|
#include <nlohmann/json.hpp>
|
|
|
|
#include <optional>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
class launchpad;
|
|
|
|
|
|
|
|
#ifndef LAUNCHPAD_API
|
|
|
|
#ifdef BUILDING_LAUNCHPAD
|
|
|
|
#define LAUNCHPAD_API __attribute__((visibility("default")))
|
|
|
|
#else
|
|
|
|
#define LAUNCHPAD_API
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
class LAUNCHPAD_API archive {
|
|
|
|
public:
|
|
|
|
archive();
|
|
|
|
~archive();
|
|
|
|
|
|
|
|
static std::optional<archive> parse(const std::string& json_data);
|
|
|
|
void parse_json(const std::string& json_data);
|
|
|
|
void set_lp(launchpad* lp_ptr);
|
|
|
|
|
|
|
|
// New public member variables
|
|
|
|
int authorized_size;
|
|
|
|
bool build_debug_symbols;
|
|
|
|
std::string description;
|
|
|
|
std::string displayname;
|
|
|
|
std::string distribution_link;
|
|
|
|
std::string external_dependencies;
|
|
|
|
nlohmann::json metadata_overrides;
|
|
|
|
std::string name;
|
|
|
|
std::string owner_link;
|
|
|
|
bool permit_obsolete_series_uploads;
|
|
|
|
bool is_private;
|
|
|
|
bool publish;
|
|
|
|
bool publish_debug_symbols;
|
|
|
|
std::string publishing_method;
|
|
|
|
int relative_build_score;
|
|
|
|
std::string repository_format;
|
|
|
|
bool require_virtualized;
|
|
|
|
std::string signing_key_fingerprint;
|
|
|
|
bool suppress_subscription_notifications;
|
|
|
|
std::string owner_name;
|
|
|
|
std::string ppa_name;
|
|
|
|
std::string self_link;
|
|
|
|
|
|
|
|
// Read-only fields
|
|
|
|
std::string dependencies_collection_link;
|
|
|
|
std::string enabled_restricted_processors_collection_link;
|
|
|
|
std::string http_etag;
|
|
|
|
std::string processors_collection_link;
|
|
|
|
std::string reference;
|
|
|
|
std::string resource_type_link;
|
|
|
|
std::string status;
|
|
|
|
std::string web_link;
|
|
|
|
|
|
|
|
// Public functions
|
|
|
|
std::generator<source_package_publishing_history> getPublishedSources(const std::string& status) const;
|
|
|
|
std::generator<archive_permission> archive::getAllPermissions() const;
|
|
|
|
|
|
|
|
launchpad* lp;
|
|
|
|
|
|
|
|
private:
|
|
|
|
std::string build_archive_endpoint() const;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // ARCHIVE_H
|