95 lines
2.1 KiB
C++
95 lines
2.1 KiB
C++
//
|
|
// Created by Shell on 2026-06-18.
|
|
//
|
|
|
|
#ifndef SEADISK_REPO_INFO_HPP
|
|
#define SEADISK_REPO_INFO_HPP
|
|
#include <cstdint>
|
|
#include <string>
|
|
#include <nlohmann/json.hpp>
|
|
|
|
namespace seafile::api
|
|
{
|
|
/**
|
|
*@brief Seafile repository metadata.
|
|
*/
|
|
struct RepoInfo final
|
|
{
|
|
/// Object type, usually "repo".
|
|
std::string type;
|
|
|
|
/// Repository UUID.
|
|
std::string id;
|
|
|
|
/// Repository owner identifier.
|
|
std::string owner;
|
|
|
|
/// Repository name.
|
|
std::string name;
|
|
|
|
/// Last modification time (Unix timestamp, seconds).
|
|
std::int64_t mtime{};
|
|
|
|
/// Repository size in bytes.
|
|
std::uint64_t size{};
|
|
|
|
/// Indicates whether the repository is encrypted.
|
|
bool encrypted{};
|
|
|
|
/// Root directory object ID.
|
|
std::string root;
|
|
|
|
/// Current user's permission (e.g. "r", "rw").
|
|
std::string permission;
|
|
|
|
/// Internal email address of the last modifier.
|
|
std::string modifier_email;
|
|
|
|
/// Contact email address of the last modifier.
|
|
std::string modifier_contact_email;
|
|
|
|
/// Display name of the last modifier.
|
|
std::string modifier_name;
|
|
|
|
/// Total number of files in the repository.
|
|
std::uint64_t file_count{};
|
|
|
|
/// Head commit identifier.
|
|
std::string head_commit_id;
|
|
|
|
/// Repository encryption version.
|
|
int enc_version{};
|
|
|
|
/// Encryption salt.
|
|
std::string salt;
|
|
|
|
/// Encryption magic value.
|
|
std::string magic;
|
|
|
|
/// Repository random key.
|
|
std::string random_key;
|
|
|
|
NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT(
|
|
RepoInfo,
|
|
type,
|
|
id,
|
|
owner,
|
|
name,
|
|
mtime,
|
|
size,
|
|
encrypted,
|
|
root,
|
|
permission,
|
|
modifier_email,
|
|
modifier_contact_email,
|
|
modifier_name,
|
|
file_count,
|
|
head_commit_id,
|
|
enc_version,
|
|
salt,
|
|
magic,
|
|
random_key)
|
|
};
|
|
}
|
|
#endif //SEADISK_REPO_INFO_HPP
|