Go to the documentation of this file.
15 class UploadContentJob :
public BaseJob {
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;
static std::map< std::string, std::string > buildHeader(std::optional< std::string > contentType)
Definition: content-repo.cpp:14
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:46
Definition: content-repo.hpp:303
Get the configuration for the content repository.
Definition: content-repo.hpp:494
Download content from the content repository overriding the file name.
Definition: content-repo.hpp:192
Definition: content-repo.hpp:412
static constexpr auto needsAuth()
Definition: content-repo.hpp:332
Body data() const
The content that was previously uploaded.
Definition: content-repo.hpp:230
Body data() const
A thumbnail of the requested content.
Definition: content-repo.hpp:324
Body data() const
The content that was previously uploaded.
Definition: content-repo.hpp:126
Definition: content-repo.hpp:94
UploadContentJob withData(JsonWrap j) &&
Definition: content-repo.cpp:68
Definition: location.hpp:26
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
static constexpr auto needsAuth()
Definition: content-repo.hpp:134
static const immer::array< std::string > expectedContentTypes
Definition: content-repo.hpp:276
static constexpr auto needsAuth()
Definition: content-repo.hpp:517
Definition: location.hpp:10
std::optional< std::string > contentType() const
The content type of the file that was previously uploaded.
Definition: content-repo.hpp:207
Definition: basejob.hpp:90
std::optional< std::string > contentType() const
The content type of the file that was previously uploaded.
Definition: content-repo.hpp:104
Download a thumbnail of content from the content repository.
Definition: content-repo.hpp:298
bool success() const
Definition: content-repo.cpp:85
static constexpr auto needsAuth()
Definition: content-repo.hpp:40
std::optional< std::string > contentDisposition() const
The name of the file that was previously uploaded, if set.
Definition: content-repo.hpp:115
static const immer::array< std::string > expectedContentTypes
Definition: content-repo.hpp:169
std::optional< std::string > contentType() const
The content type of the thumbnail.
Definition: content-repo.hpp:313
Definition: location.hpp:10
Definition: content-repo.hpp:499
JobResponse(Response r)
Definition: content-repo.cpp:82
static BaseJob::Query buildQuery(std::optional< std::string > filename)
Definition: content-repo.cpp:24
Definition: content-repo.hpp:24
Download content from the content repository.
Definition: content-repo.hpp:89
static constexpr auto needsAuth()
Definition: content-repo.hpp:432
Definition: jsonwrap.hpp:22
static BaseJob::Body buildBody(FileDesc content, std::optional< std::string > filename, std::optional< std::string > contentType)
Definition: content-repo.cpp:33
static const immer::array< std::string > expectedContentTypes
Definition: content-repo.hpp:379
Definition: basejob.hpp:76
Upload some content to the content repository.
Definition: content-repo.hpp:17
static constexpr auto needsAuth()
Definition: content-repo.hpp:238
::Kazv::Body Body
Definition: basejob.hpp:100
Definition: file-desc.hpp:224
std::string contentUri() const
The MXC URI to the uploaded content.
Definition: content-repo.cpp:96
Definition: content-repo.hpp:197
Get information about a URL for a client.
Definition: content-repo.hpp:407
Definition: basejob.hpp:50