6#include <userver/clients/http/request.hpp>
7#include <userver/clients/http/response.hpp>
8#include <userver/utils/str_icase.hpp>
10#include <userver/s3api/clients/s3api.hpp>
11#include <userver/s3api/models/fwd.hpp>
12#include <userver/s3api/models/s3api_connection_type.hpp>
14USERVER_NAMESPACE_BEGIN
16namespace clients::http {
27 clients::http::Client& http_client,
28 S3ConnectionType connection_type,
29 std::string server_url,
32 : api_url_(std::move(server_url)),
33 connection_type_(connection_type),
34 http_client_(http_client),
39 ~S3Connection() =
default;
41 std::shared_ptr<clients::http::Response> RequestApi(
Request& r, std::string_view method_name);
43 std::shared_ptr<clients::http::Response> DoStartApiRequest(
const Request& r)
const;
45 std::shared_ptr<clients::http::Response> StartApiRequest(
const Request& r)
const;
47 std::string GetHost()
const {
return api_url_; }
49 void UpdateConfig(
ConnectionCfg&& config) { config_ = config; }
52 std::string GetUrl(
const Request& r, S3ConnectionType connection_type)
const;
56 const std::string api_url_;
57 S3ConnectionType connection_type_;
58 clients::http::Client& http_client_;
63 clients::http::Client& http_client,
64 S3ConnectionType connection_type,
65 std::string server_url,