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);
178 using namespace Kazv;
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;
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;
429std::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);
473 using namespace Kazv;
514std::optional<std::int_fast64_t>
uploadSize()
const;
527 , std::string _accessToken
549 using namespace Kazv;
Definition content-repo.hpp:500
bool success() const
Definition content-repo.cpp:472
std::optional< std::int_fast64_t > uploadSize() const
The maximum size an upload can be in bytes.
Definition content-repo.cpp:482
Get the configuration for the content repository.
Definition content-repo.hpp:494
GetConfigJob withData(JsonWrap j) &&
Definition content-repo.cpp:455
static constexpr auto needsAuth()
Definition content-repo.hpp:517
static BaseJob::Query buildQuery()
Definition content-repo.cpp:415
static BaseJob::Body buildBody()
Definition content-repo.cpp:423
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
bool success() const
Definition content-repo.cpp:164
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
GetContentJob withData(JsonWrap j) &&
Definition content-repo.cpp:147
static BaseJob::Query buildQuery(bool allowRemote)
Definition content-repo.cpp:106
static BaseJob::Body buildBody(std::string serverName, std::string mediaId, bool allowRemote)
Definition content-repo.cpp:115
static const immer::array< std::string > expectedContentTypes
Definition content-repo.hpp:169
Definition content-repo.hpp:198
bool success() const
Definition content-repo.cpp:234
Body data() const
The content that was previously uploaded.
Definition content-repo.hpp:230
std::optional< std::string > contentType() const
The content type of the file that was previously uploaded.
Definition content-repo.hpp:207
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
GetContentOverrideNameJob withData(JsonWrap j) &&
Definition content-repo.cpp:217
static constexpr auto needsAuth()
Definition content-repo.hpp:238
static BaseJob::Query buildQuery(bool allowRemote)
Definition content-repo.cpp:176
static BaseJob::Body buildBody(std::string serverName, std::string mediaId, std::string fileName, bool allowRemote)
Definition content-repo.cpp:185
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
bool success() const
Definition content-repo.cpp:310
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
GetContentThumbnailJob withData(JsonWrap j) &&
Definition content-repo.cpp:293
static BaseJob::Query buildQuery(int width, int height, std::optional< std::string > method, bool allowRemote)
Definition content-repo.cpp:246
static const immer::array< std::string > expectedContentTypes
Definition content-repo.hpp:379
static constexpr auto needsAuth()
Definition content-repo.hpp:332
static BaseJob::Body buildBody(std::string serverName, std::string mediaId, int width, int height, std::optional< std::string > method, bool allowRemote)
Definition content-repo.cpp:261
Definition content-repo.hpp:413
bool success() const
Definition content-repo.cpp:382
std::optional< std::string > ogImage() const
An MXC URI to the image. Omitted if there is no image.
Definition content-repo.cpp:403
std::optional< std::int_fast64_t > matrixImageSize() const
The byte-size of the image. Omitted if there is no image attached.
Definition content-repo.cpp:392
Get information about a URL for a client.
Definition content-repo.hpp:407
GetUrlPreviewJob withData(JsonWrap j) &&
Definition content-repo.cpp:365
static BaseJob::Query buildQuery(std::string url, std::optional< std::int_fast64_t > ts)
Definition content-repo.cpp:322
static BaseJob::Body buildBody(std::string url, std::optional< std::int_fast64_t > ts)
Definition content-repo.cpp:333
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
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
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:94
Definition basejob.hpp:68
std::string url() const
Definition basejob.cpp:111
::Kazv::Body Body
Definition basejob.hpp:103
Definition file-desc.hpp:225
Definition jsonwrap.hpp:23
Definition location.hpp:10
Definition location.hpp:10
Definition location.hpp:27
Definition basejob.hpp:49
Header header
Definition basejob.hpp:53
Body body
Definition basejob.hpp:52