diff --git a/PocketSharp/Components/ModifyTags.cs b/PocketSharp/Components/ModifyTags.cs index 5ddf45e..9cf24e5 100644 --- a/PocketSharp/Components/ModifyTags.cs +++ b/PocketSharp/Components/ModifyTags.cs @@ -119,6 +119,23 @@ namespace PocketSharp } + /// + /// Deletes a tag. This will remove it from all affected items too. + /// + /// The tag. + /// The cancellation token. + /// + /// + public async Task DeleteTag(string tag, CancellationToken cancellationToken = default(CancellationToken)) + { + return await Send(new PocketAction() + { + Action = "tag_delete", + Tag = tag + }, cancellationToken); + } + + /// /// Replaces all existing tags with the given tags in an item. /// diff --git a/PocketSharp/IPocketClient.cs b/PocketSharp/IPocketClient.cs index 7cfba6e..55b14fb 100644 --- a/PocketSharp/IPocketClient.cs +++ b/PocketSharp/IPocketClient.cs @@ -413,6 +413,15 @@ namespace PocketSharp /// Task RemoveTags(PocketItem item, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a tag. This will remove it from all affected items too. + /// + /// The tag. + /// The cancellation token. + /// + /// + Task DeleteTag(string tag, CancellationToken cancellationToken = default(CancellationToken)) + /// /// Replaces all existing tags with the given tags in an item. /// diff --git a/PocketSharp/Models/PocketAction.cs b/PocketSharp/Models/PocketAction.cs index ba8c071..7ff63e9 100644 --- a/PocketSharp/Models/PocketAction.cs +++ b/PocketSharp/Models/PocketAction.cs @@ -1,4 +1,4 @@ -using Newtonsoft.Json; +using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Runtime.Serialization; @@ -94,6 +94,15 @@ namespace PocketSharp.Models [DataMember(Name = "new_tag")] public string NewTag { get; set; } + /// + /// Gets or sets the tag. + /// + /// + /// The old tag. + /// + [DataMember(Name = "tag")] + public string Tag { get; set; } + /// /// Converts this instance to a parameter list. @@ -116,6 +125,8 @@ namespace PocketSharp.Models parameters.Add("old_tag", OldTag); if (NewTag != null) parameters.Add("new_tag", NewTag); + if (Tag != null) + parameters.Add("tag", Tag); if (!String.IsNullOrEmpty(Title)) parameters.Add("title", Title); if (!String.IsNullOrEmpty(TweetID))