#include <maps/wikimap/mapspro/libs/social_serv_serialize/include/task_user_data.h>
#include <yandex/maps/wiki/social/feedback/attribute_names.h>

using namespace maps::wiki::social::feedback;

namespace maps::wiki::socialsrv::serialize {

TaskUserData::TaskUserData(const Task& task)
{
    const auto& attrs = task.attrs();
    if (attrs.existCustom(attrs::USER_DATA_COMMENT)) {
        comment = attrs.getCustom(attrs::USER_DATA_COMMENT);
    }
    if (attrs.existCustom(attrs::USER_DATA_SEARCH_REQUEST)) {
        searchRequest = attrs.getCustom(attrs::USER_DATA_SEARCH_REQUEST);
    }
    if (attrs.exist(AttrType::UserDataPhotoUrls)) {
        photoUrls = attrs.get(AttrType::UserDataPhotoUrls);
    }
}


} // namespace maps::wiki::socialsrv::serialize
