public static PhotoAlbum FromJson(VkResponse response)
{
VkResponseArray privacy = response["privacy_view"];
VkResponseArray privacyComment = response["privacy_comment"];
return new PhotoAlbum
{
Id = response["album_id"] ?? response["aid"] ?? response["id"],
ThumbId = Utilities.GetNullableLongId(response["thumb_id"]),
OwnerId = Utilities.GetNullableLongId(response["owner_id"]),
Title = response["title"],
Description = response["description"],
Created = response["created"],
Updated = response["updated"],
Size = response["size"],
PrivacyView = privacy.ToReadOnlyCollectionOf<Privacy>(x => x),
PrivacyComment = privacyComment.ToReadOnlyCollectionOf<Privacy>(x => x),
CanUpload = response["can_upload"],
ThumbSrc = response["thumb_src"],
Sizes = response["sizes"].ToReadOnlyCollectionOf<PhotoSize>(x => x),
CommentsDisabled = response["comments_disabled"],
UploadByAdminsOnly = response["upload_by_admins_only"],
ThumbIsLast = response["thumb_is_last"]
};
}