/*
 * Copyright (C) 2016 Canonical Ltd
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License version 3 as
 * published by the Free Software Foundation.
 *
 * 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 Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Authors: James Henstridge <james.henstridge@canonical.com>
 */

#pragma once

#include <lomiri/storage/provider/ProviderBase.h>

class TestProvider : public lomiri::storage::provider::ProviderBase {
public:
    boost::future<lomiri::storage::provider::ItemList> roots(
        std::vector<std::string> const& keys,
        lomiri::storage::provider::Context const& ctx) override;
    boost::future<std::tuple<lomiri::storage::provider::ItemList,std::string>> list(
        std::string const& item_id, std::string const& page_token,
        std::vector<std::string> const& keys,
        lomiri::storage::provider::Context const& ctx) override;
    boost::future<lomiri::storage::provider::ItemList> lookup(
        std::string const& parent_id, std::string const& name,
        std::vector<std::string> const& keys,
        lomiri::storage::provider::Context const& ctx) override;
    boost::future<lomiri::storage::provider::Item> metadata(
        std::string const& item_id, std::vector<std::string> const& keys,
        lomiri::storage::provider::Context const& ctx) override;
    boost::future<lomiri::storage::provider::Item> create_folder(
        std::string const& parent_id, std::string const& name,
        std::vector<std::string> const& keys,
        lomiri::storage::provider::Context const& ctx) override;

    boost::future<std::unique_ptr<lomiri::storage::provider::UploadJob>> create_file(
        std::string const& parent_id, std::string const& name,
        int64_t size, std::string const& content_type, bool allow_overwrite,
        std::vector<std::string> const& keys,
        lomiri::storage::provider::Context const& ctx) override;
    boost::future<std::unique_ptr<lomiri::storage::provider::UploadJob>> update(
        std::string const& item_id, int64_t size, std::string const& old_etag,
        std::vector<std::string> const& keys,
        lomiri::storage::provider::Context const& ctx) override;

    boost::future<std::unique_ptr<lomiri::storage::provider::DownloadJob>> download(
        std::string const& item_id, std::string const& match_etag,
        lomiri::storage::provider::Context const& ctx) override;

    boost::future<void> delete_item(
        std::string const& item_id,
        lomiri::storage::provider::Context const& ctx) override;
    boost::future<lomiri::storage::provider::Item> move(
        std::string const& item_id, std::string const& new_parent_id,
        std::string const& new_name, std::vector<std::string> const& keys,
        lomiri::storage::provider::Context const& ctx) override;
    boost::future<lomiri::storage::provider::Item> copy(
        std::string const& item_id, std::string const& new_parent_id,
        std::string const& new_name, std::vector<std::string> const& keys,
        lomiri::storage::provider::Context const& ctx) override;
};
