Repos
C++
461 B18 lines Opens in site
Directory
Raw
Download
#include "model/BookmarkItem.hpp"
#include "core/JsonDecode.hpp"
namespace dp {
BookmarkItem BookmarkItem::fromJson(const Json& j) {
using D = JsonDecode;
BookmarkItem b;
b.targetType = D::req<std::string>(j, "target_type");
b.targetId = D::req<std::string>(j, "target_uid");
b.typeLabel = D::req<std::string>(j, "type_label");
b.title = D::req<std::string>(j, "title");
b.url = D::req<std::string>(j, "url");
return b;
}
} // namespace dp