diff --git a/Synology/DownloadStation/TaskMinimalResult.cs b/Synology/DownloadStation/TaskMinimalResult.cs new file mode 100644 index 0000000..d2dffaa --- /dev/null +++ b/Synology/DownloadStation/TaskMinimalResult.cs @@ -0,0 +1,12 @@ +using System; + +namespace Synology.DownloadStation +{ + public class TaskMinimalResult + { + public string Id { get; set; } + + public int Error{ get; set; } + } +} + diff --git a/Synology/DownloadStation/TaskRequest.cs b/Synology/DownloadStation/TaskRequest.cs index 6153b13..b37e71e 100644 --- a/Synology/DownloadStation/TaskRequest.cs +++ b/Synology/DownloadStation/TaskRequest.cs @@ -1,5 +1,7 @@ using Synology.Classes; using Synology.Utilities; +using System.Collections; +using System.Collections.Generic; namespace Synology.DownloadStation { @@ -21,7 +23,7 @@ public ResultData List(int offset = 0, int limit = -1, string ad return Connection.GetDataFromUrl(url); } - public ResultData Info(string[] ids, string additional = null) + public ResultData> Info(string[] ids, string additional = null) { var additionalParams = new[] { new QueryStringParameter("id", ids), @@ -29,7 +31,7 @@ public ResultData Info(string[] ids, string additional = null) }; var url = GetApiUrl("getinfo", 1, additionalParams); - return Connection.GetDataFromUrl(url); + return Connection.GetDataFromUrl>(url); } public ResultData Create(string uri, string file, string username, string password, string unzipPassword, string destination) @@ -47,7 +49,7 @@ public ResultData Create(string uri, string file, string username, string passwo return Connection.GetDataFromUrl(url); } - public ResultData Delete(string[] ids, bool forceComplete) + public ResultData> Delete(string[] ids, bool forceComplete) { var additionalParams = new[] { new QueryStringParameter("id", ids), @@ -55,30 +57,30 @@ public ResultData Delete(string[] ids, bool forceComplete) }; var url = GetApiUrl("delete", 1, additionalParams); - return Connection.GetDataFromUrl(url); + return Connection.GetDataFromUrl>(url); } - public ResultData Pause(string[] ids) + public ResultData> Pause(string[] ids) { var additionalParams = new[] { new QueryStringParameter("id", ids) }; var url = GetApiUrl("pause", 1, additionalParams); - return Connection.GetDataFromUrl(url); + return Connection.GetDataFromUrl>(url); } - public ResultData Resume(string[] ids) + public ResultData> Resume(string[] ids) { var additionalParams = new[] { new QueryStringParameter("id", ids), }; var url = GetApiUrl("resume", 1, additionalParams); - return Connection.GetDataFromUrl(url); + return Connection.GetDataFromUrl>(url); } - public ResultData Edit(string[] ids, string destination = null) + public ResultData> Edit(string[] ids, string destination = null) { var additionalParams = new[] { new QueryStringParameter("id", ids), @@ -87,7 +89,7 @@ public ResultData Edit(string[] ids, string destination = null) var url = GetApiUrl("edit", 1, additionalParams); - return Connection.GetDataFromUrl(url); + return Connection.GetDataFromUrl>(url); } } } diff --git a/Synology/Synology.csproj b/Synology/Synology.csproj index d962408..5fe926f 100644 --- a/Synology/Synology.csproj +++ b/Synology/Synology.csproj @@ -59,6 +59,7 @@ +