diff --git a/src/WindreamHub.Legacy.Client/Routes/DocumentsRouteService.cs b/src/WindreamHub.Legacy.Client/Routes/DocumentsRouteService.cs index 1d30bd9..f0b24db 100644 --- a/src/WindreamHub.Legacy.Client/Routes/DocumentsRouteService.cs +++ b/src/WindreamHub.Legacy.Client/Routes/DocumentsRouteService.cs @@ -59,7 +59,33 @@ namespace WindreamHub.Legacy.Client.Routes return await FetchAsync(route: $"/Upload?{query}", method: HttpMethod.Post, body: fileContent).ThenAsync(res => res.Simplify()); } } - - + + public async Task> Update(DocBody docUpdateBody) + => await FetchAsync(route: "/Update", method: HttpMethod.Post, body: docUpdateBody.Stringify()) + .ThenAsync(res => res.Simplify()); + + public async Task> Download(long? item_id = null, string item_location = null, string item_name = null, object stream_identity = null, params Flag[] flags) + { + var query = HttpUtility.ParseQueryString(string.Empty); + + if (item_id != null) + query["parameter.item.id"] = item_id.ToString(); + + if (item_location != null) + query["parameter.item.location"] = item_location; + + if (item_name != null) + query["parameter.item.name"] = item_name; + + if (flags != null && flags.Length > 0) + query["parameter.flags"] = string.Join(",", flags.Select(flag => (int)flag)); + + if (stream_identity != null) + query["parameter.stream.__identity"] = stream_identity.ToString(); + + + + return await FetchAsync(route: $"/Download?{query}", method: HttpMethod.Get).ThenAsync(res => res.Simplify()); + } } } \ No newline at end of file diff --git a/src/WindreamHub.Legacy.Client/WindreamHub.Legacy.Client.csproj b/src/WindreamHub.Legacy.Client/WindreamHub.Legacy.Client.csproj index eda8b2d..d707da4 100644 --- a/src/WindreamHub.Legacy.Client/WindreamHub.Legacy.Client.csproj +++ b/src/WindreamHub.Legacy.Client/WindreamHub.Legacy.Client.csproj @@ -127,6 +127,8 @@ PreserveNewest - + + + \ No newline at end of file