56 , std::string _accessToken
58 FileDesc content , std::optional<std::string> filename = std::nullopt, std::optional<std::string> contentType = std::nullopt
63 std::optional<std::string> filename);
67 static std::map<std::string, std::string>
buildHeader(std::optional<std::string> contentType);
106 auto it = header->find(
"Content-Type");
107 if (it != header->end()) {
117 auto it = header->find(
"Content-Disposition");
118 if (it != header->end()) {
158 std::string serverName , std::string mediaId ,
bool allowRemote =
true
159 , std::optional<FileDesc> downloadTo = std::nullopt);
165 static BaseJob::Body buildBody(std::string serverName, std::string mediaId,
bool allowRemote);
178 using namespace Kazv;
202 bool success()
const;
209 auto it = header->find(
"Content-Type");
210 if (it != header->end()) {
221 auto it = header->find(
"Content-Disposition");
222 if (it != header->end()) {
265 std::string serverName , std::string mediaId , std::string fileName ,
bool allowRemote =
true
266 , std::optional<FileDesc> downloadTo = std::nullopt);
272 static BaseJob::Body buildBody(std::string serverName, std::string mediaId, std::string fileName,
bool allowRemote);
285 using namespace Kazv;
308 bool success()
const;
315 auto it = header->find(
"Content-Type");
316 if (it != header->end()) {
368 std::string serverName , std::string mediaId ,
int width ,
int height , std::optional<std::string> method = std::nullopt,
bool allowRemote =
true
369 , std::optional<FileDesc> downloadTo = std::nullopt);
373 int width,
int height, std::optional<std::string> method,
bool allowRemote);
375 static BaseJob::Body buildBody(std::string serverName, std::string mediaId,
int width,
int height, std::optional<std::string> method,
bool allowRemote);
388 using namespace Kazv;
417 bool success()
const;
425 std::optional<std::int_fast64_t> matrixImageSize()
const;
429 std::optional<std::string> ogImage()
const;
451 , std::string _accessToken
453 std::string url , std::optional<std::int_fast64_t> ts = std::nullopt
458 std::string url, std::optional<std::int_fast64_t> ts);
460 static BaseJob::Body buildBody(std::string url, std::optional<std::int_fast64_t> ts);
473 using namespace Kazv;
504 bool success()
const;
514 std::optional<std::int_fast64_t> uploadSize()
const;
527 , std::string _accessToken
549 using namespace Kazv;
Definition: content-repo.hpp:500
Get the configuration for the content repository.
Definition: content-repo.hpp:494
static constexpr auto needsAuth()
Definition: content-repo.hpp:517
Definition: content-repo.hpp:95
Body data() const
The content that was previously uploaded.
Definition: content-repo.hpp:126
std::optional< std::string > contentType() const
The content type of the file that was previously uploaded.
Definition: content-repo.hpp:104
std::optional< std::string > contentDisposition() const
The name of the file that was previously uploaded, if set.
Definition: content-repo.hpp:115
Download content from the content repository.
Definition: content-repo.hpp:89
static constexpr auto needsAuth()
Definition: content-repo.hpp:134
static const immer::array< std::string > expectedContentTypes
Definition: content-repo.hpp:169
Definition: content-repo.hpp:198
std::optional< std::string > contentType() const
The content type of the file that was previously uploaded.
Definition: content-repo.hpp:207
Body data() const
The content that was previously uploaded.
Definition: content-repo.hpp:230
std::optional< std::string > contentDisposition() const
The fileName requested or the name of the file that was previously uploaded, if set.
Definition: content-repo.hpp:219
Download content from the content repository overriding the file name.
Definition: content-repo.hpp:192
static constexpr auto needsAuth()
Definition: content-repo.hpp:238
static const immer::array< std::string > expectedContentTypes
Definition: content-repo.hpp:276
Definition: content-repo.hpp:304
std::optional< std::string > contentType() const
The content type of the thumbnail.
Definition: content-repo.hpp:313
Body data() const
A thumbnail of the requested content.
Definition: content-repo.hpp:324
Download a thumbnail of content from the content repository.
Definition: content-repo.hpp:298
static const immer::array< std::string > expectedContentTypes
Definition: content-repo.hpp:379
static constexpr auto needsAuth()
Definition: content-repo.hpp:332
Definition: content-repo.hpp:413
Get information about a URL for a client.
Definition: content-repo.hpp:407
static constexpr auto needsAuth()
Definition: content-repo.hpp:432
Definition: content-repo.hpp:21
std::string contentUri() const
The MXC URI to the uploaded content.
Definition: content-repo.cpp:94
JobResponse(Response r)
Definition: content-repo.cpp:80
bool success() const
Definition: content-repo.cpp:83
Upload some content to the content repository.
Definition: content-repo.hpp:15
static std::map< std::string, std::string > buildHeader(std::optional< std::string > contentType)
Definition: content-repo.cpp:12
static BaseJob::Query buildQuery(std::optional< std::string > filename)
Definition: content-repo.cpp:22
UploadContentJob withData(JsonWrap j) &&
Definition: content-repo.cpp:66
UploadContentJob(std::string serverUrl, std::string _accessToken, FileDesc content, std::optional< std::string > filename=std::nullopt, std::optional< std::string > contentType=std::nullopt)
Upload some content to the content repository.
Definition: content-repo.cpp:44
static constexpr auto needsAuth()
Definition: content-repo.hpp:36
static BaseJob::Body buildBody(FileDesc content, std::optional< std::string > filename, std::optional< std::string > contentType)
Definition: content-repo.cpp:31
Definition: basejob.hpp:91
Definition: basejob.hpp:77
::Kazv::Body Body
Definition: basejob.hpp:100
Definition: file-desc.hpp:225
Definition: jsonwrap.hpp:23
Definition: location.hpp:10
Definition: location.hpp:10
Definition: location.hpp:27
Definition: basejob.hpp:50