docs for mixes + opml + preferences

This commit is contained in:
2014-11-26 22:03:05 +01:00
parent 32e49fa82b
commit 4e911eb53c
5 changed files with 43 additions and 13 deletions
-3
View File
@@ -11,7 +11,6 @@ namespace FeedlySharp
{
/// <summary>
/// Returns all categories created by the user.
/// Authentication required.
/// </summary>
/// <remarks>categories-endpoint (https://developer.feedly.com/v3/categories/#get-the-list-of-all-categories)</remarks>
/// <param name="cancellationToken">The cancellation token.</param>
@@ -23,7 +22,6 @@ namespace FeedlySharp
/// <summary>
/// Renames a user category.
/// Authentication required.
/// </summary>
/// <remarks>categories-endpoint (https://developer.feedly.com/v3/categories/#change-the-label-of-an-existing-category)</remarks>
/// <param name="id">The category id.</param>
@@ -37,7 +35,6 @@ namespace FeedlySharp
/// <summary>
/// Deletes a user category.
/// Authentication required.
/// </summary>
/// <remarks>categories-endpoint (https://developer.feedly.com/v3/categories/#delete-a-category)</remarks>
/// <param name="id">The category id.</param>
-2
View File
@@ -1,12 +1,10 @@
using FeedlySharp.Models;
using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using System.Linq;
using System.Dynamic;
namespace FeedlySharp
{
+13
View File
@@ -9,6 +9,19 @@ namespace FeedlySharp
{
public partial class FeedlyClient
{
/// <summary>
/// Get a mix of the most engaging content available in a stream.
/// </summary>
/// <remarks>mixes-endpoint (https://developer.feedly.com/v3/mixes/#get-a-mix-of-the-most-engaging-content-available-in-a-stream)</remarks>
/// <param name="contentId">A feed id, a category id, the system category ids or a topic id.</param>
/// <param name="count">Number of entry ids to return. default is 3. max is 20.</param>
/// <param name="unreadOnly">if set to <c>true</c> [return unread content only].</param>
/// <param name="limitHours">Hour of the day. Used for same day optimization: only articles published in the past n hours will be used. This is a more convenient parameter than “newerThan”; both parameters should not be passed in the same request.</param>
/// <param name="newerThan">Date from where to fetch the data.</param>
/// <param name="backfill">If “hours” is provided, and there arent enough articles to match the entry count requested, the server will look back in time to find more articles. Articles from the first n hours will be returned first.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns></returns>
/// <exception cref="System.ArgumentException">It is not possible to use both newerThan and limitHours</exception>
public async Task<List<FeedlyEntry>> GetMixes(
string contentId,
int? count = null,
+14 -4
View File
@@ -1,7 +1,4 @@
using FeedlySharp.Models;
using System;
using System.Collections.Generic;
using System.Net;
using System;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
@@ -10,12 +7,25 @@ namespace FeedlySharp
{
public partial class FeedlyClient
{
/// <summary>
/// Export the user's subscriptions as an OPML file.
/// </summary>
/// <remarks>OPML-endpoint (https://developer.feedly.com/v3/opml/#export-the-users-subscriptions-as-an-opml-file)</remarks>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns></returns>
public async Task<string> GetOPML(CancellationToken cancellationToken = default(CancellationToken))
{
return await Client.Request(HttpMethod.Get, "v3/opml", null, false, true, cancellationToken);
}
/// <summary>
/// Import an OPML.
/// </summary>
/// <remarks>OPML-endpoint (https://developer.feedly.com/v3/opml/#import-an-opml)</remarks>
/// <param name="opml">The OPML input.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns></returns>
public async Task<bool> ImportOPML(string opml, CancellationToken cancellationToken = default(CancellationToken))
{
HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, "v3/opml");
+16 -4
View File
@@ -1,7 +1,4 @@
using FeedlySharp.Models;
using System;
using System.Collections.Generic;
using System.Net;
using System.Collections.Generic;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
@@ -10,12 +7,27 @@ namespace FeedlySharp
{
public partial class FeedlyClient
{
/// <summary>
/// Get the preferences of the user.
/// Applications can store and sync some user preferences. For example, Feedly stores the views users assign to each category and feed in the preferences module. Preferences are application specific - applications can not share preferences.
/// An application can save up to 10,000 preference knobs per user.
/// </summary>
/// <remarks>preferences-endpoint (https://developer.feedly.com/v3/preferences/#get-the-preferences-of-the-user)</remarks>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>A string dictionary, as the preferences list is dynamic and different for every application.</returns>
public async Task<Dictionary<string, string>> GetPreferences(CancellationToken cancellationToken = default(CancellationToken))
{
return (await Client.Request<Dictionary<string, string>>(HttpMethod.Get, "v3/preferences", null, false, true, cancellationToken)) ?? new Dictionary<string, string>();
}
/// <summary>
/// Update the preferences of the user.
/// </summary>
/// <remarks>preferences-endpoint (https://developer.feedly.com/v3/preferences/#update-the-preferences-of-the-user)</remarks>
/// <param name="preferences">The new or updated preferences. If you wish to delete a key, you can pass the special value "==DELETE==".</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>A string dictionary, as the preferences list is dynamic and different for every application.</returns>
public async Task<Dictionary<string, string>> UpdatePreferences(Dictionary<string, string> preferences, CancellationToken cancellationToken = default(CancellationToken))
{
return (await Client.Request<Dictionary<string, string>>(HttpMethod.Post, "v3/preferences", preferences, true, true, cancellationToken)) ?? new Dictionary<string, string>();