using VkNet.Utils;

namespace VkNet.Model
{
	/// <summary>
	/// Ðåçóëüòàò êîïèðîâàíèÿ çàïèñè íà ñòåíó è èíôîðìàöèÿ î íåé.
	/// </summary>
	public class RepostResult
	{
		/// <summary>
		/// Ðåçóëüòàò êîïèðîâàíèÿ
		/// </summary>
		public bool Success { get; set; }

		/// <summary>
		/// Èäåíòèôèêàòîð ñîçäàííîé çàïèñè
		/// </summary>
		public long? PostId { get; set; }

		/// <summary>
		/// ×èñëî êîïèðîâàíèé èñõîäíîé çàïèñè ñ ó÷åòîì îñóùåñòâëåííîãî
		/// </summary>
		public int? RepostsCount { get; set; }

		/// <summary>
		/// ×èñëî îòìåòîê "Ìíå íðàâèòñÿ" ó èñõîäíîé çàïèñè
		/// </summary>
		public int? LikesCount { get; set; }


		#region Ìåòîäû

		internal static RepostResult FromJson(VkResponse response)
		{
			var result = new RepostResult();

			result.Success = response["success"];
			result.PostId = response["post_id"];
			result.RepostsCount = response["reposts_count"];
			result.LikesCount = response["likes_count"];

			return result;
		}

		#endregion

	}
}