#ifndef OSS_H
#define OSS_H
#include <memory>
#include <string>
#include <chrono>
#include <iomanip>
#include <ctime>
#include <fstream>

#include "oss_properties.h"
#include "common/logging.h"


namespace zsy
{
    struct OSSConfig
    {
        OssProperties oss;
    };

    inline void from_json(const nlohmann::json &j, OSSConfig &o)
    {
        PARSE_JSON(oss, o.oss);
    }

    class OSS
    {
        OssProperties config;

    public:
        OSS(const nlohmann::json &config);

        std::tuple<bool, std::string> upload(const std::string &objectName, std::shared_ptr<std::istream> file);

        std::tuple<bool, std::string> upload(const std::string &objectName, const std::string &filePath);
    };
} // zsy

#endif //OSS_H
