respect normal_uri, if submitted; PocketItem.ID as string
This commit is contained in:
@@ -76,7 +76,7 @@ namespace PocketSharp
|
|||||||
{
|
{
|
||||||
return await Read(new PocketItem()
|
return await Read(new PocketItem()
|
||||||
{
|
{
|
||||||
ID = 0,
|
ID = null,
|
||||||
Uri = uri
|
Uri = uri
|
||||||
}, bodyOnly, noHeadline);
|
}, bodyOnly, noHeadline);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ namespace PocketSharp.Tests
|
|||||||
|
|
||||||
Assert.False(items.Count > 0);
|
Assert.False(items.Count > 0);
|
||||||
|
|
||||||
PocketItem item = await client.Get(99999999);
|
PocketItem item = await client.Get("99999999");
|
||||||
|
|
||||||
Assert.Null(item);
|
Assert.Null(item);
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
using System;
|
using PocketSharp.Models;
|
||||||
using System.Threading.Tasks;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Xunit;
|
|
||||||
using PocketSharp.Models;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Xunit;
|
||||||
|
|
||||||
namespace PocketSharp.Tests
|
namespace PocketSharp.Tests
|
||||||
{
|
{
|
||||||
@@ -83,7 +83,7 @@ namespace PocketSharp.Tests
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private async Task<PocketItem> GetItemById(int id, bool archive = false)
|
private async Task<PocketItem> GetItemById(string id, bool archive = false)
|
||||||
{
|
{
|
||||||
List<PocketItem> items = await client.Get(state: archive ? State.archive : State.unread);
|
List<PocketItem> items = await client.Get(state: archive ? State.archive : State.unread);
|
||||||
PocketItem itemDesired = null;
|
PocketItem itemDesired = null;
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ namespace PocketSharp.Tests
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private async Task<PocketItem> GetItemById(int id, bool archive = false)
|
private async Task<PocketItem> GetItemById(string id, bool archive = false)
|
||||||
{
|
{
|
||||||
List<PocketItem> items = await client.Get(state: archive ? State.archive : State.unread);
|
List<PocketItem> items = await client.Get(state: archive ? State.archive : State.unread);
|
||||||
PocketItem itemDesired = null;
|
PocketItem itemDesired = null;
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ namespace PocketSharp.Tests
|
|||||||
{
|
{
|
||||||
PocketArticle result = await reader.Read(new PocketItem()
|
PocketArticle result = await reader.Read(new PocketItem()
|
||||||
{
|
{
|
||||||
ID = 99,
|
ID = "99",
|
||||||
Uri = new Uri("http://frontendplay.com/story/4/http-caching-demystified-part-2-implementation")
|
Uri = new Uri("http://frontendplay.com/story/4/http-caching-demystified-part-2-implementation")
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -37,7 +37,7 @@ namespace PocketSharp.Tests
|
|||||||
{
|
{
|
||||||
PocketArticle result = await reader.Read(new PocketItem()
|
PocketArticle result = await reader.Read(new PocketItem()
|
||||||
{
|
{
|
||||||
ID = 99,
|
ID = "99",
|
||||||
Uri = new Uri("http://frontendplay.com/story/4/http-caching-demystified-part-2-implementation")
|
Uri = new Uri("http://frontendplay.com/story/4/http-caching-demystified-part-2-implementation")
|
||||||
}, false, true);
|
}, false, true);
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@ namespace PocketSharp.Tests
|
|||||||
{
|
{
|
||||||
await reader.Read(new PocketItem()
|
await reader.Read(new PocketItem()
|
||||||
{
|
{
|
||||||
ID = 99,
|
ID = "99",
|
||||||
Uri = new Uri("http://frontendplayyyyy.com")
|
Uri = new Uri("http://frontendplayyyyy.com")
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -66,7 +66,7 @@ namespace PocketSharp.Tests
|
|||||||
{
|
{
|
||||||
PocketArticle result = await reader.Read(new PocketItem()
|
PocketArticle result = await reader.Read(new PocketItem()
|
||||||
{
|
{
|
||||||
ID = 99,
|
ID = "99",
|
||||||
Uri = new Uri("http://calebjacob.com/tooltipster/")
|
Uri = new Uri("http://calebjacob.com/tooltipster/")
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Threading.Tasks;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
using PocketSharp.Models;
|
|
||||||
|
|
||||||
namespace PocketSharp.Tests
|
namespace PocketSharp.Tests
|
||||||
{
|
{
|
||||||
@@ -10,7 +9,7 @@ namespace PocketSharp.Tests
|
|||||||
{
|
{
|
||||||
protected PocketClient client;
|
protected PocketClient client;
|
||||||
|
|
||||||
protected List<int> itemsToDelete = new List<int>();
|
protected List<string> itemsToDelete = new List<string>();
|
||||||
|
|
||||||
|
|
||||||
// setup
|
// setup
|
||||||
@@ -26,7 +25,7 @@ namespace PocketSharp.Tests
|
|||||||
|
|
||||||
|
|
||||||
// teardown
|
// teardown
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
itemsToDelete.ForEach(async id =>
|
itemsToDelete.ForEach(async id =>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ namespace PocketSharp
|
|||||||
/// <param name="cancellationToken">The cancellation token.</param>
|
/// <param name="cancellationToken">The cancellation token.</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="PocketException"></exception>
|
/// <exception cref="PocketException"></exception>
|
||||||
public async Task<PocketItem> Get(int itemID, CancellationToken cancellationToken = default(CancellationToken))
|
public async Task<PocketItem> Get(string itemID, CancellationToken cancellationToken = default(CancellationToken))
|
||||||
{
|
{
|
||||||
List<PocketItem> items = await Get(
|
List<PocketItem> items = await Get(
|
||||||
cancellationToken: cancellationToken,
|
cancellationToken: cancellationToken,
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ namespace PocketSharp
|
|||||||
/// <param name="cancellationToken">The cancellation token.</param>
|
/// <param name="cancellationToken">The cancellation token.</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="PocketException"></exception>
|
/// <exception cref="PocketException"></exception>
|
||||||
public async Task<bool> Archive(int itemID, CancellationToken cancellationToken = default(CancellationToken))
|
public async Task<bool> Archive(string itemID, CancellationToken cancellationToken = default(CancellationToken))
|
||||||
{
|
{
|
||||||
return await SendDefault(cancellationToken, itemID, "archive");
|
return await SendDefault(cancellationToken, itemID, "archive");
|
||||||
}
|
}
|
||||||
@@ -57,7 +57,7 @@ namespace PocketSharp
|
|||||||
/// <param name="cancellationToken">The cancellation token.</param>
|
/// <param name="cancellationToken">The cancellation token.</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="PocketException"></exception>
|
/// <exception cref="PocketException"></exception>
|
||||||
public async Task<bool> Unarchive(int itemID, CancellationToken cancellationToken = default(CancellationToken))
|
public async Task<bool> Unarchive(string itemID, CancellationToken cancellationToken = default(CancellationToken))
|
||||||
{
|
{
|
||||||
return await SendDefault(cancellationToken, itemID, "readd");
|
return await SendDefault(cancellationToken, itemID, "readd");
|
||||||
}
|
}
|
||||||
@@ -83,7 +83,7 @@ namespace PocketSharp
|
|||||||
/// <param name="cancellationToken">The cancellation token.</param>
|
/// <param name="cancellationToken">The cancellation token.</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="PocketException"></exception>
|
/// <exception cref="PocketException"></exception>
|
||||||
public async Task<bool> Favorite(int itemID, CancellationToken cancellationToken = default(CancellationToken))
|
public async Task<bool> Favorite(string itemID, CancellationToken cancellationToken = default(CancellationToken))
|
||||||
{
|
{
|
||||||
return await SendDefault(cancellationToken, itemID, "favorite");
|
return await SendDefault(cancellationToken, itemID, "favorite");
|
||||||
}
|
}
|
||||||
@@ -109,7 +109,7 @@ namespace PocketSharp
|
|||||||
/// <param name="cancellationToken">The cancellation token.</param>
|
/// <param name="cancellationToken">The cancellation token.</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="PocketException"></exception>
|
/// <exception cref="PocketException"></exception>
|
||||||
public async Task<bool> Unfavorite(int itemID, CancellationToken cancellationToken = default(CancellationToken))
|
public async Task<bool> Unfavorite(string itemID, CancellationToken cancellationToken = default(CancellationToken))
|
||||||
{
|
{
|
||||||
return await SendDefault(cancellationToken, itemID, "unfavorite");
|
return await SendDefault(cancellationToken, itemID, "unfavorite");
|
||||||
}
|
}
|
||||||
@@ -135,7 +135,7 @@ namespace PocketSharp
|
|||||||
/// <param name="itemID">The item ID.</param>
|
/// <param name="itemID">The item ID.</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="PocketException"></exception>
|
/// <exception cref="PocketException"></exception>
|
||||||
public async Task<bool> Delete(int itemID, CancellationToken cancellationToken = default(CancellationToken))
|
public async Task<bool> Delete(string itemID, CancellationToken cancellationToken = default(CancellationToken))
|
||||||
{
|
{
|
||||||
return await SendDefault(cancellationToken, itemID, "delete");
|
return await SendDefault(cancellationToken, itemID, "delete");
|
||||||
}
|
}
|
||||||
@@ -160,7 +160,7 @@ namespace PocketSharp
|
|||||||
/// <param name="itemID">The item ID.</param>
|
/// <param name="itemID">The item ID.</param>
|
||||||
/// <param name="action">The action.</param>
|
/// <param name="action">The action.</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
protected async Task<bool> SendDefault(CancellationToken cancellationToken, int itemID, string action)
|
protected async Task<bool> SendDefault(CancellationToken cancellationToken, string itemID, string action)
|
||||||
{
|
{
|
||||||
return await Send(new PocketAction()
|
return await Send(new PocketAction()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ namespace PocketSharp
|
|||||||
/// <param name="cancellationToken">The cancellation token.</param>
|
/// <param name="cancellationToken">The cancellation token.</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="PocketException"></exception>
|
/// <exception cref="PocketException"></exception>
|
||||||
public async Task<bool> AddTags(int itemID, string[] tags, CancellationToken cancellationToken = default(CancellationToken))
|
public async Task<bool> AddTags(string itemID, string[] tags, CancellationToken cancellationToken = default(CancellationToken))
|
||||||
{
|
{
|
||||||
return await SendTags(cancellationToken, itemID, "tags_add", tags);
|
return await SendTags(cancellationToken, itemID, "tags_add", tags);
|
||||||
}
|
}
|
||||||
@@ -45,7 +45,7 @@ namespace PocketSharp
|
|||||||
/// <param name="cancellationToken">The cancellation token.</param>
|
/// <param name="cancellationToken">The cancellation token.</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="PocketException"></exception>
|
/// <exception cref="PocketException"></exception>
|
||||||
public async Task<bool> RemoveTags(int itemID, string[] tags, CancellationToken cancellationToken = default(CancellationToken))
|
public async Task<bool> RemoveTags(string itemID, string[] tags, CancellationToken cancellationToken = default(CancellationToken))
|
||||||
{
|
{
|
||||||
return await SendTags(cancellationToken, itemID, "tags_remove", tags);
|
return await SendTags(cancellationToken, itemID, "tags_remove", tags);
|
||||||
}
|
}
|
||||||
@@ -73,7 +73,7 @@ namespace PocketSharp
|
|||||||
/// <param name="cancellationToken">The cancellation token.</param>
|
/// <param name="cancellationToken">The cancellation token.</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="PocketException"></exception>
|
/// <exception cref="PocketException"></exception>
|
||||||
public async Task<bool> RemoveTag(int itemID, string tag, CancellationToken cancellationToken = default(CancellationToken))
|
public async Task<bool> RemoveTag(string itemID, string tag, CancellationToken cancellationToken = default(CancellationToken))
|
||||||
{
|
{
|
||||||
return await SendTags(cancellationToken, itemID, "tags_remove", new string[] { tag });
|
return await SendTags(cancellationToken, itemID, "tags_remove", new string[] { tag });
|
||||||
}
|
}
|
||||||
@@ -100,7 +100,7 @@ namespace PocketSharp
|
|||||||
/// <param name="cancellationToken">The cancellation token.</param>
|
/// <param name="cancellationToken">The cancellation token.</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="PocketException"></exception>
|
/// <exception cref="PocketException"></exception>
|
||||||
public async Task<bool> RemoveTags(int itemID, CancellationToken cancellationToken = default(CancellationToken))
|
public async Task<bool> RemoveTags(string itemID, CancellationToken cancellationToken = default(CancellationToken))
|
||||||
{
|
{
|
||||||
return await SendDefault(cancellationToken, itemID, "tags_clear");
|
return await SendDefault(cancellationToken, itemID, "tags_clear");
|
||||||
}
|
}
|
||||||
@@ -127,7 +127,7 @@ namespace PocketSharp
|
|||||||
/// <param name="cancellationToken">The cancellation token.</param>
|
/// <param name="cancellationToken">The cancellation token.</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="PocketException"></exception>
|
/// <exception cref="PocketException"></exception>
|
||||||
public async Task<bool> ReplaceTags(int itemID, string[] tags, CancellationToken cancellationToken = default(CancellationToken))
|
public async Task<bool> ReplaceTags(string itemID, string[] tags, CancellationToken cancellationToken = default(CancellationToken))
|
||||||
{
|
{
|
||||||
return await SendTags(cancellationToken, itemID, "tags_replace", tags);
|
return await SendTags(cancellationToken, itemID, "tags_replace", tags);
|
||||||
}
|
}
|
||||||
@@ -156,7 +156,7 @@ namespace PocketSharp
|
|||||||
/// <param name="cancellationToken">The cancellation token.</param>
|
/// <param name="cancellationToken">The cancellation token.</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="PocketException"></exception>
|
/// <exception cref="PocketException"></exception>
|
||||||
public async Task<bool> RenameTag(int itemID, string oldTag, string newTag, CancellationToken cancellationToken = default(CancellationToken))
|
public async Task<bool> RenameTag(string itemID, string oldTag, string newTag, CancellationToken cancellationToken = default(CancellationToken))
|
||||||
{
|
{
|
||||||
return await Send(new PocketAction()
|
return await Send(new PocketAction()
|
||||||
{
|
{
|
||||||
@@ -191,7 +191,7 @@ namespace PocketSharp
|
|||||||
/// <param name="action">The action.</param>
|
/// <param name="action">The action.</param>
|
||||||
/// <param name="tags">The tags.</param>
|
/// <param name="tags">The tags.</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
protected async Task<bool> SendTags(CancellationToken cancellationToken, int itemID, string action, string[] tags)
|
protected async Task<bool> SendTags(CancellationToken cancellationToken, string itemID, string action, string[] tags)
|
||||||
{
|
{
|
||||||
return await Send(new PocketAction()
|
return await Send(new PocketAction()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ namespace PocketSharp
|
|||||||
/// <param name="cancellationToken">The cancellation token.</param>
|
/// <param name="cancellationToken">The cancellation token.</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="PocketException"></exception>
|
/// <exception cref="PocketException"></exception>
|
||||||
Task<PocketItem> Get(int itemID, CancellationToken cancellationToken = default(CancellationToken));
|
Task<PocketItem> Get(string itemID, CancellationToken cancellationToken = default(CancellationToken));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Retrieves all items by a given filter
|
/// Retrieves all items by a given filter
|
||||||
@@ -220,7 +220,7 @@ namespace PocketSharp
|
|||||||
/// <param name="cancellationToken">The cancellation token.</param>
|
/// <param name="cancellationToken">The cancellation token.</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="PocketException"></exception>
|
/// <exception cref="PocketException"></exception>
|
||||||
Task<bool> Archive(int itemID, CancellationToken cancellationToken = default(CancellationToken));
|
Task<bool> Archive(string itemID, CancellationToken cancellationToken = default(CancellationToken));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Archives the specified item.
|
/// Archives the specified item.
|
||||||
@@ -238,7 +238,7 @@ namespace PocketSharp
|
|||||||
/// <param name="cancellationToken">The cancellation token.</param>
|
/// <param name="cancellationToken">The cancellation token.</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="PocketException"></exception>
|
/// <exception cref="PocketException"></exception>
|
||||||
Task<bool> Unarchive(int itemID, CancellationToken cancellationToken = default(CancellationToken));
|
Task<bool> Unarchive(string itemID, CancellationToken cancellationToken = default(CancellationToken));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Unarchives the specified item.
|
/// Unarchives the specified item.
|
||||||
@@ -256,7 +256,7 @@ namespace PocketSharp
|
|||||||
/// <param name="cancellationToken">The cancellation token.</param>
|
/// <param name="cancellationToken">The cancellation token.</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="PocketException"></exception>
|
/// <exception cref="PocketException"></exception>
|
||||||
Task<bool> Favorite(int itemID, CancellationToken cancellationToken = default(CancellationToken));
|
Task<bool> Favorite(string itemID, CancellationToken cancellationToken = default(CancellationToken));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Favorites the specified item.
|
/// Favorites the specified item.
|
||||||
@@ -274,7 +274,7 @@ namespace PocketSharp
|
|||||||
/// <param name="cancellationToken">The cancellation token.</param>
|
/// <param name="cancellationToken">The cancellation token.</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="PocketException"></exception>
|
/// <exception cref="PocketException"></exception>
|
||||||
Task<bool> Unfavorite(int itemID, CancellationToken cancellationToken = default(CancellationToken));
|
Task<bool> Unfavorite(string itemID, CancellationToken cancellationToken = default(CancellationToken));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Un-favorites the specified item.
|
/// Un-favorites the specified item.
|
||||||
@@ -292,7 +292,7 @@ namespace PocketSharp
|
|||||||
/// <param name="cancellationToken">The cancellation token.</param>
|
/// <param name="cancellationToken">The cancellation token.</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="PocketException"></exception>
|
/// <exception cref="PocketException"></exception>
|
||||||
Task<bool> Delete(int itemID, CancellationToken cancellationToken = default(CancellationToken));
|
Task<bool> Delete(string itemID, CancellationToken cancellationToken = default(CancellationToken));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Deletes the specified item.
|
/// Deletes the specified item.
|
||||||
@@ -312,7 +312,7 @@ namespace PocketSharp
|
|||||||
/// <param name="cancellationToken">The cancellation token.</param>
|
/// <param name="cancellationToken">The cancellation token.</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="PocketException"></exception>
|
/// <exception cref="PocketException"></exception>
|
||||||
Task<bool> AddTags(int itemID, string[] tags, CancellationToken cancellationToken = default(CancellationToken));
|
Task<bool> AddTags(string itemID, string[] tags, CancellationToken cancellationToken = default(CancellationToken));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds the specified tags to an item.
|
/// Adds the specified tags to an item.
|
||||||
@@ -332,7 +332,7 @@ namespace PocketSharp
|
|||||||
/// <param name="cancellationToken">The cancellation token.</param>
|
/// <param name="cancellationToken">The cancellation token.</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="PocketException"></exception>
|
/// <exception cref="PocketException"></exception>
|
||||||
Task<bool> RemoveTags(int itemID, string[] tags, CancellationToken cancellationToken = default(CancellationToken));
|
Task<bool> RemoveTags(string itemID, string[] tags, CancellationToken cancellationToken = default(CancellationToken));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Removes the specified tags from an item.
|
/// Removes the specified tags from an item.
|
||||||
@@ -352,7 +352,7 @@ namespace PocketSharp
|
|||||||
/// <param name="cancellationToken">The cancellation token.</param>
|
/// <param name="cancellationToken">The cancellation token.</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="PocketException"></exception>
|
/// <exception cref="PocketException"></exception>
|
||||||
Task<bool> RemoveTag(int itemID, string tag, CancellationToken cancellationToken = default(CancellationToken));
|
Task<bool> RemoveTag(string itemID, string tag, CancellationToken cancellationToken = default(CancellationToken));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Removes a tag from an item.
|
/// Removes a tag from an item.
|
||||||
@@ -371,7 +371,7 @@ namespace PocketSharp
|
|||||||
/// <param name="cancellationToken">The cancellation token.</param>
|
/// <param name="cancellationToken">The cancellation token.</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="PocketException"></exception>
|
/// <exception cref="PocketException"></exception>
|
||||||
Task<bool> RemoveTags(int itemID, CancellationToken cancellationToken = default(CancellationToken));
|
Task<bool> RemoveTags(string itemID, CancellationToken cancellationToken = default(CancellationToken));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Clears all tags from an item.
|
/// Clears all tags from an item.
|
||||||
@@ -390,7 +390,7 @@ namespace PocketSharp
|
|||||||
/// <param name="cancellationToken">The cancellation token.</param>
|
/// <param name="cancellationToken">The cancellation token.</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="PocketException"></exception>
|
/// <exception cref="PocketException"></exception>
|
||||||
Task<bool> ReplaceTags(int itemID, string[] tags, CancellationToken cancellationToken = default(CancellationToken));
|
Task<bool> ReplaceTags(string itemID, string[] tags, CancellationToken cancellationToken = default(CancellationToken));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Replaces all existing tags with the given new ones in an item.
|
/// Replaces all existing tags with the given new ones in an item.
|
||||||
@@ -411,7 +411,7 @@ namespace PocketSharp
|
|||||||
/// <param name="cancellationToken">The cancellation token.</param>
|
/// <param name="cancellationToken">The cancellation token.</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="PocketException"></exception>
|
/// <exception cref="PocketException"></exception>
|
||||||
Task<bool> RenameTag(int itemID, string oldTag, string newTag, CancellationToken cancellationToken = default(CancellationToken));
|
Task<bool> RenameTag(string itemID, string oldTag, string newTag, CancellationToken cancellationToken = default(CancellationToken));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Renames a tag in an item.
|
/// Renames a tag in an item.
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ namespace PocketSharp.Models
|
|||||||
/// The ID.
|
/// The ID.
|
||||||
/// </value>
|
/// </value>
|
||||||
[DataMember(Name = "item_id")]
|
[DataMember(Name = "item_id")]
|
||||||
public int ID { get; set; }
|
public string ID { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the URI (for adding a new item).
|
/// Gets or sets the URI (for adding a new item).
|
||||||
@@ -105,7 +105,7 @@ namespace PocketSharp.Models
|
|||||||
{ "action", Action }
|
{ "action", Action }
|
||||||
};
|
};
|
||||||
|
|
||||||
if (ID != 0 && !String.IsNullOrEmpty(ID.ToString()))
|
if (ID != "0" && !String.IsNullOrEmpty(ID.ToString()))
|
||||||
parameters.Add("item_id", ID.ToString());
|
parameters.Add("item_id", ID.ToString());
|
||||||
if (Time != null)
|
if (Time != null)
|
||||||
parameters.Add("time", Time != null ? Utilities.GetUnixTimestamp(Time).ToString() : null);
|
parameters.Add("time", Time != null ? Utilities.GetUnixTimestamp(Time).ToString() : null);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
using System;
|
using PropertyChanged;
|
||||||
using PropertyChanged;
|
using System;
|
||||||
|
|
||||||
namespace PocketSharp.Models
|
namespace PocketSharp.Models
|
||||||
{
|
{
|
||||||
@@ -15,7 +15,7 @@ namespace PocketSharp.Models
|
|||||||
/// <value>
|
/// <value>
|
||||||
/// The pocket item ID.
|
/// The pocket item ID.
|
||||||
/// </value>
|
/// </value>
|
||||||
public int PocketItemID { get; set; }
|
public string PocketItemID { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the content.
|
/// Gets or sets the content.
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
using System.Diagnostics;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json;
|
|
||||||
using PropertyChanged;
|
using PropertyChanged;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
|
||||||
namespace PocketSharp.Models
|
namespace PocketSharp.Models
|
||||||
{
|
{
|
||||||
@@ -22,7 +22,7 @@ namespace PocketSharp.Models
|
|||||||
/// The ID.
|
/// The ID.
|
||||||
/// </value>
|
/// </value>
|
||||||
[JsonProperty("item_id")]
|
[JsonProperty("item_id")]
|
||||||
public int ID { get; set; }
|
public string ID { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the resolved identifier.
|
/// Gets or sets the resolved identifier.
|
||||||
@@ -33,14 +33,36 @@ namespace PocketSharp.Models
|
|||||||
[JsonProperty("resolved_id")]
|
[JsonProperty("resolved_id")]
|
||||||
public string ResolvedId { get; set; }
|
public string ResolvedId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the normal URI.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>
|
||||||
|
/// The normal URI.
|
||||||
|
/// </value>
|
||||||
|
[JsonProperty("normal_url")]
|
||||||
|
private Uri _NormalUri { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the resolved URI.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>
|
||||||
|
/// The resolved URI.
|
||||||
|
/// </value>
|
||||||
|
[JsonProperty("resolved_url")]
|
||||||
|
private Uri _ResolvedUri { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the URI.
|
/// Gets or sets the URI.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>
|
/// <value>
|
||||||
/// The URI.
|
/// The URI.
|
||||||
/// </value>
|
/// </value>
|
||||||
[JsonProperty("resolved_url")]
|
[JsonIgnore]
|
||||||
public Uri Uri { get; set; }
|
public Uri Uri
|
||||||
|
{
|
||||||
|
get { return _ResolvedUri ?? _NormalUri; }
|
||||||
|
set { _NormalUri = value; _ResolvedUri = value; }
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the title.
|
/// Gets or sets the title.
|
||||||
|
|||||||
Reference in New Issue
Block a user