5 #include <Quotient/jobs/basejob.h>
30 QString displayName{};
44 explicit SearchUserDirectoryJob(
const QString& searchTerm,
45 std::optional<
int> limit = std::nullopt);
50 QVector<User> results()
const {
return loadFromJson<QVector<User>>(
"results"_L1); }
53 bool limited()
const {
return loadFromJson<
bool>(
"limited"_L1); }
57 QVector<User> results{};
64 template <std::derived_from<SearchUserDirectoryJob> JobT>
65 constexpr inline auto doCollectResponse<JobT> =
66 [](JobT* j) -> SearchUserDirectoryJob::Response {
return { j->results(), j->limited() }; };
69 struct QUOTIENT_API JsonObjectConverter<SearchUserDirectoryJob::User> {
70 static void fillFrom(
const QJsonObject& jo, SearchUserDirectoryJob::User& result)
72 fillFromJson(jo.value(
"user_id"_L1), result.userId);
73 fillFromJson(jo.value(
"display_name"_L1), result.displayName);
74 fillFromJson(jo.value(
"avatar_url"_L1), result.avatarUrl);