Added the application tester for CP #9

This commit is contained in:
tidusjar 2016-03-14 14:03:01 +00:00
commit 4c0884999e
9 changed files with 175 additions and 3 deletions

View file

@ -30,6 +30,8 @@ using Newtonsoft.Json.Linq;
using NLog;
using PlexRequests.Api.Interfaces;
using PlexRequests.Api.Models.Movie;
using RestSharp;
namespace PlexRequests.Api
@ -71,5 +73,25 @@ namespace PlexRequests.Api
}
return false;
}
/// <summary>
/// Gets the status.
/// </summary>
/// <param name="url">The URL.</param>
/// <param name="apiKey">The API key.</param>
/// <returns></returns>
public CouchPotatoStatus GetStatus(Uri url, string apiKey)
{
Log.Trace("Getting CP Status, ApiKey = {0}", apiKey);
var request = new RestRequest
{
Resource = "api/{apikey}/app.available/",
Method = Method.GET
};
request.AddUrlSegment("apikey", apiKey);
return Api.Execute<CouchPotatoStatus>(request,url);
}
}
}