using System; using System.Collections.Generic; using System.Linq; using Nancy; using Nancy.Metadata.Modules; using Nancy.Metadata.Swagger.Core; using Nancy.Metadata.Swagger.Fluent; using Sony.Filtr.AdminAPI.ViewModels.Spotify.Browse; using Sony.Filtr.Core.SpotifyBrowse.Data; namespace Sony.Filtr.AdminAPI.Modules.SpotifySpecific { public class SpotifyBrowseMetadataModule : MetadataModule { public SpotifyBrowseMetadataModule() { const string tag = "Browse"; Describe["GetSpotifyBrowse"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Get Spotify Browse data for the specified date", tag) .WithRequestParameter("date", type: "string", description: "Date", loc: "query") .WithResponse(HttpStatusCode.BadRequest, "Missing date") .WithDefaultResponse>()); //Describe["GetSpotifyBrowseExcel"] = description => new SwaggerRouteMetadata(description).With(c => // c.WithDescription("Get Spotify Browse data for the specified date in CSV-format", tag) // .WithRequestParameter("date", type: "string", description: "Date", loc: "query") // .WithResponse(HttpStatusCode.BadRequest, "Missing date") // .WithResponse(HttpStatusCode.OK, "Browse data in CSV-format")); Describe["GetSpotifyBrowseDates"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Get dates with available Spotify Browse data", tag) .WithRequestParameter("countryCode", loc: "path", description: "Market Id") .WithDefaultResponse>()); Describe["GetSpotifyBrowseUtcDates"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Get dates with available Spotify Browse data in UTC format", tag) .WithRequestParameter("countryCode", loc: "path", description: "Market Id") .WithDefaultResponse>()); Describe["GetSpotifyBrowseCategoryStats"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Get Spotify Browse stats for categories", tag) .WithRequestParameter("date", description: "The date or the value latest for latest data") .WithRequestParameter("countryCode", description: "Market id") .WithResponse(HttpStatusCode.BadRequest, "Missing or invalid market") .WithDefaultResponse()); Describe["GetSpotifyBrowseCategory"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Get detailed Spotify Browse stats for one category", tag) .WithRequestParameter("date", description: "The date or the value latest for latest data") .WithRequestParameter("category", description: "Category") .WithRequestParameter("countryCode", description: "Market id") .WithResponse(HttpStatusCode.BadRequest, "Missing or invalid market") .WithDefaultResponse()); Describe["GetSpotifyBrowsePlaylist"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Get the regions and categories that a certain playlist is included in for the specified date", tag) .WithRequestParameter("date", description: "The date or the value latest for latest data") .WithRequestParameter("playlistUri", description: "PlaylistUri for the playlist to lookup") .WithResponse(HttpStatusCode.BadRequest, "Missing or invalid playlistUri") .WithDefaultResponse>()); Describe["GetSpotifyBrowseExport"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Get exported csv data for Spotify Browse", tag) .WithRequestParameter("date", description: "The date or the value latest for latest data") .WithRequestParameter("countryCode", description: "Market id") .WithRequestParameter("global", type: "bool", description: "Set to true to get global browse export", loc: "query") .WithResponse(HttpStatusCode.OK, "CSV with Market, Date, Category, Position, Peak, URI, Username, Name, Owner, SME Owner Market, Users, Streams, Followers")); } } }