#pragma once
#include <string>
#include <vector>
#include <functional>

class GetbinClient {
public:
    GetbinClient();
    
    // Progress callback: (downloaded_bytes, total_bytes) -> should_continue
    using ProgressCallback = std::function<bool(size_t, size_t)>;
    
    bool download(const std::string& toolName, const std::string& arch, const std::string& outPath, 
                  ProgressCallback progressCallback = nullptr);
    bool upload(const std::string& archivePath, std::string& outUrl, std::string& outHash, const std::string& token,
                ProgressCallback progressCallback = nullptr);
    bool getHash(const std::string& toolName, const std::string& arch, std::string& outHash);
    bool deleteObject(const std::string& hash, const std::string& token);
    bool listPackages(std::vector<std::string>& outPackages);
    bool listAllEntries(std::vector<std::pair<std::string, std::vector<std::string>>>& outEntries);
    
private:
    static const std::string SERVER_HOST;
    std::string getUserAgent() const;
};
