From 177d9cc1721aa347eeb7cc015a97361d04106437 Mon Sep 17 00:00:00 2001 From: LukePulverenti Date: Mon, 11 Mar 2013 01:06:55 -0400 Subject: consolidated some api code --- MediaBrowser.Api/UserLibrary/BaseItemsRequest.cs | 58 ++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 MediaBrowser.Api/UserLibrary/BaseItemsRequest.cs (limited to 'MediaBrowser.Api/UserLibrary/BaseItemsRequest.cs') diff --git a/MediaBrowser.Api/UserLibrary/BaseItemsRequest.cs b/MediaBrowser.Api/UserLibrary/BaseItemsRequest.cs new file mode 100644 index 000000000..ed1beab6f --- /dev/null +++ b/MediaBrowser.Api/UserLibrary/BaseItemsRequest.cs @@ -0,0 +1,58 @@ +using MediaBrowser.Model.Entities; +using ServiceStack.ServiceHost; +using System; + +namespace MediaBrowser.Api.UserLibrary +{ + public abstract class BaseItemsRequest + { + /// + /// Gets or sets the user id. + /// + /// The user id. + [ApiMember(Name = "UserId", Description = "User Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")] + public Guid UserId { get; set; } + + /// + /// Skips over a given number of items within the results. Use for paging. + /// + /// The start index. + [ApiMember(Name = "StartIndex", Description = "Optional. The record index to start at. All items with a lower index will be dropped from the results.", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")] + public int? StartIndex { get; set; } + + /// + /// The maximum number of items to return + /// + /// The limit. + [ApiMember(Name = "Limit", Description = "Optional. The maximum number of records to return", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")] + public int? Limit { get; set; } + + /// + /// Whether or not to perform the query recursively + /// + /// true if recursive; otherwise, false. + [ApiMember(Name = "Recursive", Description = "When searching within folders, this determines whether or not the search will be recursive. true/false", IsRequired = false, DataType = "boolean", ParameterType = "query", Verb = "GET")] + public bool Recursive { get; set; } + + /// + /// Gets or sets the sort order. + /// + /// The sort order. + [ApiMember(Name = "SortOrder", Description = "Sort Order - Ascending,Descending", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")] + public SortOrder? SortOrder { get; set; } + + /// + /// Specify this to localize the search to a specific item or folder. Omit to use the root. + /// + /// The parent id. + [ApiMember(Name = "ParentId", Description = "Specify this to localize the search to a specific item or folder. Omit to use the root", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")] + public string ParentId { get; set; } + + /// + /// Fields to return within the items, in addition to basic information + /// + /// The fields. + [ApiMember(Name = "Fields", Description = "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimeted. Options: AudioInfo, Chapters, DateCreated, DisplayMediaType, DisplayPreferences, Genres, ItemCounts, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, SeriesInfo, SortName, Studios, Taglines, TrailerUrls, UserData", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET", AllowMultiple = true)] + public string Fields { get; set; } + } +} -- cgit v1.2.3