From c4c9126f79f43ad865cfa670bda90a94ffb39d9c Mon Sep 17 00:00:00 2001 From: LukePulverenti Date: Fri, 8 Mar 2013 14:14:09 -0500 Subject: added more attributes for api docs --- MediaBrowser.Api/EnvironmentService.cs | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'MediaBrowser.Api/EnvironmentService.cs') diff --git a/MediaBrowser.Api/EnvironmentService.cs b/MediaBrowser.Api/EnvironmentService.cs index 6296711ed..dfa5eee42 100644 --- a/MediaBrowser.Api/EnvironmentService.cs +++ b/MediaBrowser.Api/EnvironmentService.cs @@ -16,34 +16,49 @@ namespace MediaBrowser.Api /// Class GetDirectoryContents /// [Route("/Environment/DirectoryContents", "GET")] + [ServiceStack.ServiceHost.Api(Description = "Gets the contents of a given directory in the file system")] public class GetDirectoryContents : IReturn> { /// /// Gets or sets the path. /// /// The path. + [ApiMember(Name = "Path", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "GET")] public string Path { get; set; } + /// /// Gets or sets a value indicating whether [include files]. /// /// true if [include files]; otherwise, false. + [ApiMember(Name = "IncludeFiles", Description = "An optional filter to include or exclude files from the results.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")] public bool IncludeFiles { get; set; } + /// /// Gets or sets a value indicating whether [include directories]. /// /// true if [include directories]; otherwise, false. + [ApiMember(Name = "IncludeDirectories", Description = "An optional filter to include or exclude folders from the results.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")] public bool IncludeDirectories { get; set; } + /// /// Gets or sets a value indicating whether [include hidden]. /// /// true if [include hidden]; otherwise, false. + [ApiMember(Name = "IncludeHidden", Description = "An optional filter to include or exclude hidden files and folders.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")] public bool IncludeHidden { get; set; } + + public GetDirectoryContents() + { + IncludeDirectories = true; + IncludeFiles = true; + } } /// /// Class GetDrives /// [Route("/Environment/Drives", "GET")] + [ServiceStack.ServiceHost.Api(Description = "Gets available drives from the server's file system")] public class GetDrives : IReturn> { } @@ -51,8 +66,9 @@ namespace MediaBrowser.Api /// /// Class GetNetworkComputers /// - [Route("/Environment/NetworkComputers", "GET")] - public class GetNetworkComputers : IReturn> + [Route("/Environment/NetworkDevices", "GET")] + [ServiceStack.ServiceHost.Api(Description = "Gets a list of devices on the network")] + public class GetNetworkDevices : IReturn> { } @@ -128,9 +144,9 @@ namespace MediaBrowser.Api /// /// The request. /// System.Object. - public object Get(GetNetworkComputers request) + public object Get(GetNetworkDevices request) { - var result = GetNetworkComputers().ToList(); + var result = GetNetworkDevices().ToList(); return ToOptimizedResult(result); } @@ -155,7 +171,7 @@ namespace MediaBrowser.Api /// Gets the network computers. /// /// IEnumerable{FileSystemEntryInfo}. - private IEnumerable GetNetworkComputers() + private IEnumerable GetNetworkDevices() { return _networkManager.GetNetworkDevices().Select(c => new FileSystemEntryInfo { -- cgit v1.2.3