#ifndef TILE_BASE_INTERNAL_CURL_H
#define TILE_BASE_INTERNAL_CURL_H

#pragma once

#include "tile/base/expected.h"

#include <chrono>
#include <string>
#include <vector>

namespace tile {

namespace internal {
using HttpPostMockHandler =
    std::function<std::expected<std::string, int>(const std::string &,
                                                  const std::vector<std::string> &,
                                                  const std::string &,
                                                  std::chrono::nanoseconds)>;

using HttpGetMockHandler =
    std::function<std::expected<std::string, int>(const std::string &, std::chrono::nanoseconds)>;

std::expected<std::string, int>
HttpPost(const std::string &uri,
         const std::vector<std::string> &headers,
         const std::string &body,
         std::chrono::nanoseconds timeout);
std::expected<std::string, int> HttpGet(const std::string &uri, std::chrono::nanoseconds timeout);

void SetHttpPostMockHandler(HttpPostMockHandler &&handler);
void SetHttpGetMockHandler(HttpGetMockHandler &&handler);

}// namespace internal

}// namespace tile
#endif// TILE_BASE_INTERNAL_CURL_H
