using Nancy.Metadata.Modules; using Nancy.Metadata.Swagger.Core; using Nancy.Metadata.Swagger.Fluent; using Sony.Filtr.AdminAPI.ViewModels; using Sony.Filtr.Contracts.Entities; namespace Sony.Filtr.AdminAPI.Modules.SpotifySpecific { public class SpotifyPlaylistMetadataModule : MetadataModule { public SpotifyPlaylistMetadataModule() { var tag = "Spotify playlist"; Describe["GetMarketPlaylists"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Get the playlists for the specified market or that has had streams in the market", tag) .WithRequestParameter("countryCode", type: "string", description: "Market of playlists or where playlists have had streams", loc: "path", required: true) .WithRequestParameter("limit", type: "string", description: "Limit", loc: "query", required: false) .WithRequestParameter("offset", type: "string", description: "Offset", loc: "query", required: false) .WithRequestParameter("sortby", type: "string", description: "Property to sort by", loc: "query", required: false) .WithRequestParameter("sortorder", type: "string", description: "Sort order: asc/desc", loc: "query", required: false) .WithDefaultResponse>()); Describe["GetMarketPlaylistOverview"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Get an overview of the numbers (streams, followers, count) for playlists per market", tag) .WithRequestParameter("limit", type: "string", description: "Limit", loc: "query", required: false) .WithRequestParameter("offset", type: "string", description: "Offset", loc: "query", required: false) .WithRequestParameter("lastDate", type: "string", description: "Last date to use for data (defaults to today utc - 3 days).", loc: "query", required: false) .WithDefaultResponse>()); Describe["GetSpotifyPlaylistsByUser"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Gets all playlists by the specified user", tag) .WithRequestParameter("market", type: "string", description: "Include streams number for the specified market", loc: "query", required: false) .WithRequestParameter("userUri", type: "string", description: "Playlist for the specified user", loc: "query", required: true) .WithRequestParameter("limit", type: "string", description: "Limit", loc: "query", required: false) .WithRequestParameter("offset", type: "string", description: "Offset", loc: "query", required: false) .WithDefaultResponse>()); Describe["GetPlaylistsWithTrack"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Get the playlists that contains the specified track. Lookups is done by ISRC.", tag) .WithRequestParameter("market", type: "string", description: "Include streams number for the specified market", loc: "query", required: false) .WithRequestParameter("isrc", type: "string", description: "Include playlists with this track.", loc: "query", required: false) .WithRequestParameter("trackId", type: "string", description: "Include playlists with this track. (Lookup internally by isrc)", loc: "query", required: false) .WithRequestParameter("limit", type: "string", description: "Limit", loc: "query", required: false) .WithRequestParameter("offset", type: "string", description: "Offset", loc: "query", required: false) .WithDefaultResponse>()); Describe["GetMultipleSpotifyPlaylist"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Get the specified playlists from our database", tag) .WithRequestParameter("market", type: "string", description: "Include streams number for the specified market", loc: "query", required: false) .WithRequestParameter("playlistId", type: "string", description: "Include playlists with this track.", loc: "query", required: false) .WithRequestParameter("limit", type: "string", description: "Limit", loc: "query", required: false) .WithRequestParameter("offset", type: "string", description: "Offset", loc: "query", required: false) .WithRequestModel(name: "body", description: "Playlist ids to get", required: false) .WithDefaultResponse>()); Describe["GetPersonalizedPlaylists"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Get all playlist IDs which are currently identified as being personalized by Spotify", tag) .WithRequestParameter("limit", type: "string", description: "Limit (default 500)", loc: "query", required: false) .WithRequestParameter("offset", type: "string", description: "Offset", loc: "query", required: false) .WithDefaultResponse>()); } } }