10#include <unordered_map>
11#include <unordered_set>
14#include <userver/clients/http/request.hpp>
15#include <userver/clients/http/response.hpp>
16#include <userver/utils/overloaded.hpp>
17#include <userver/utils/str_icase.hpp>
19#include <userver/s3api/clients/s3api.hpp>
21#include <userver/s3api/authenticators/access_key.hpp>
22#include <userver/s3api/authenticators/interface.hpp>
23#include <userver/s3api/models/fwd.hpp>
24#include <userver/s3api/models/s3api_connection_type.hpp>
26USERVER_NAMESPACE_BEGIN
28namespace clients::http {
48 ~ClientImpl()
override =
default;
50 std::string PutObject(
51 std::string_view path,
53 const std::optional<Meta>& meta,
54 std::string_view content_type,
55 const std::optional<std::string>& content_disposition,
56 const std::optional<std::vector<Tag>>& tags
59 void DeleteObject(std::string_view path)
const final;
61 std::optional<std::string> GetObject(
62 std::string_view path,
63 std::optional<std::string> versiong,
68 std::string TryGetObject(
69 std::string_view path,
70 std::optional<std::string> versiong,
75 std::optional<std::string> GetPartialObject(
76 std::string_view path,
77 std::string_view range,
78 std::optional<std::string> versiong,
83 std::string TryGetPartialObject(
84 std::string_view path,
85 std::string_view range,
86 std::optional<std::string> versiong,
91 std::string CopyObject(
92 std::string_view key_from,
93 std::string_view bucket_to,
94 std::string_view key_to,
95 const std::optional<Meta>& meta
98 std::string CopyObject(std::string_view key_from, std::string_view key_to,
const std::optional<Meta>& meta)
final;
103 std::string GenerateDownloadUrl(std::string_view path, time_t expires,
bool use_ssl)
const final;
105 std::string GenerateDownloadUrlVirtualHostAddressing(
106 std::string_view path,
107 const std::chrono::system_clock::time_point& expires_at,
108 std::string_view protocol
111 std::string GenerateUploadUrlVirtualHostAddressing(
112 std::string_view data,
113 std::string_view content_type,
114 std::string_view path,
115 const std::chrono::system_clock::time_point& expires_at,
116 std::string_view protocol
119 std::optional<std::string>
120 ListBucketContents(std::string_view path,
int max_keys, std::string marker, std::string delimiter)
const final;
122 std::vector<ObjectMeta> ListBucketContentsParsed(std::string_view path_prefix)
const final;
124 std::vector<std::string> ListBucketDirectories(std::string_view path_prefix)
const final;
128 std::string_view GetBucketName()
const final;
131 void Auth(
Request& request)
const;
132 std::string RequestApi(
134 std::string_view method_name,