delete tag action

This commit is contained in:
2018-07-14 14:10:03 +02:00
parent a0fce1a5fb
commit 0dff3dc3de
3 changed files with 38 additions and 1 deletions
+17
View File
@@ -119,6 +119,23 @@ namespace PocketSharp
}
/// <summary>
/// Deletes a tag. This will remove it from all affected items too.
/// </summary>
/// <param name="tag">The tag.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns></returns>
/// <exception cref="PocketException"></exception>
public async Task<bool> DeleteTag(string tag, CancellationToken cancellationToken = default(CancellationToken))
{
return await Send(new PocketAction()
{
Action = "tag_delete",
Tag = tag
}, cancellationToken);
}
/// <summary>
/// Replaces all existing tags with the given tags in an item.
/// </summary>
+9
View File
@@ -413,6 +413,15 @@ namespace PocketSharp
/// <exception cref="PocketException"></exception>
Task<bool> RemoveTags(PocketItem item, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Deletes a tag. This will remove it from all affected items too.
/// </summary>
/// <param name="tag">The tag.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns></returns>
/// <exception cref="PocketException"></exception>
Task<bool> DeleteTag(string tag, CancellationToken cancellationToken = default(CancellationToken))
/// <summary>
/// Replaces all existing tags with the given tags in an item.
/// </summary>
+12 -1
View File
@@ -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; }
/// <summary>
/// Gets or sets the tag.
/// </summary>
/// <value>
/// The old tag.
/// </value>
[DataMember(Name = "tag")]
public string Tag { get; set; }
/// <summary>
/// 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))