Add deleted ChangeItem

#197
This commit is contained in:
Michael Bisbjerg 2016-08-09 23:05:09 +02:00
parent 2eb0791f9e
commit 86c8741579
4 changed files with 25 additions and 9 deletions

View File

@ -13,6 +13,9 @@ namespace TMDbLib.Objects.Changes
Created = 2,
[EnumValue("updated")]
Updated = 3
Updated = 3,
[EnumValue("deleted")]
Deleted = 4
}
}

View File

@ -0,0 +1,16 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace TMDbLib.Objects.Changes
{
public class ChangeItemDeleted : ChangeItemBase
{
public ChangeItemDeleted()
{
Action = ChangeAction.Deleted;
}
[JsonProperty("original_value")]
public JToken OriginalValue { get; set; }
}
}

View File

@ -9,16 +9,10 @@ namespace TMDbLib.Objects.Changes
{
Action = ChangeAction.Updated;
}
/// <summary>
/// This field is not always set
/// </summary>
[JsonProperty("original_value")]
public JToken OriginalValue { get; set; }
/// <summary>
/// This field is not always set
/// </summary>
[JsonProperty("value")]
public JToken Value { get; set; }
}

View File

@ -38,6 +38,9 @@ namespace TMDbLib.Utilities.Converters
case ChangeAction.Updated:
result = new ChangeItemUpdated();
break;
case ChangeAction.Deleted:
result = new ChangeItemDeleted();
break;
default:
throw new ArgumentOutOfRangeException();
}