From 30d9ca2f93ba7cc8623c7670dcb66d323864a560 Mon Sep 17 00:00:00 2001 From: Padi Date: Tue, 3 Oct 2023 10:16:50 +0000 Subject: [PATCH] [New][RedmineManagerExtension] Add GetProjectFiles (#336) --- .../Extensions/RedmineManagerExtensions.cs | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/redmine-net-api/Extensions/RedmineManagerExtensions.cs b/src/redmine-net-api/Extensions/RedmineManagerExtensions.cs index 5a1cbfce..987bc928 100644 --- a/src/redmine-net-api/Extensions/RedmineManagerExtensions.cs +++ b/src/redmine-net-api/Extensions/RedmineManagerExtensions.cs @@ -61,6 +61,14 @@ public static News AddProjectNews(this RedmineManager redmineManager, string pro return WebApiHelper.ExecuteUpload(redmineManager, Uri.EscapeUriString($"{redmineManager.Host}/project/{projectIdentifier}/news.{redmineManager.Format}"), HttpVerbs.POST, data); } + /// + /// + /// + /// + /// + /// + /// + /// public static PagedResults GetProjectMemberships(this RedmineManager redmineManager, string projectIdentifier, NameValueCollection nameValueCollection) { if (projectIdentifier.IsNullOrWhiteSpace()) @@ -70,5 +78,23 @@ public static PagedResults GetProjectMemberships(this Redmine return WebApiHelper.ExecuteDownloadList(redmineManager, Uri.EscapeUriString($"{redmineManager.Host}/project/{projectIdentifier}/memberships.{redmineManager.Format}"), nameValueCollection); } + + /// + /// + /// + /// + /// + /// + /// + /// + public static PagedResults GetProjectFiles(this RedmineManager redmineManager, string projectIdentifier, NameValueCollection nameValueCollection) + { + if (projectIdentifier.IsNullOrWhiteSpace()) + { + throw new RedmineException($"Argument '{nameof(projectIdentifier)}' is null"); + } + + return WebApiHelper.ExecuteDownloadList(redmineManager, Uri.EscapeUriString($"{redmineManager.Host}/project/{projectIdentifier}/files.{redmineManager.Format}"), nameValueCollection); + } } } \ No newline at end of file