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.Contracts.Abstractions; using Sony.Filtr.Contracts.Entities; using Sony.Filtr.Core.TrackPopularity; using Sony.Filtr.SpotifyWebAPI; namespace Sony.Filtr.AdminAPI.Modules.AnalyzeTrack { public class AnalyzeTrackMetadataModule : MetadataModule { public AnalyzeTrackMetadataModule() { const string tag = "Analyze Track"; Describe["AnalyzeTrackPopularity"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Get the popularity history for the specified track", tag) .WithRequestParameter("trackUri", description: "Spotify Track Uri", loc: "query") .WithDefaultResponse>() .WithResponse(HttpStatusCode.BadRequest, "Missing or invalid trackUri")); Describe["SpotifyTrackPopularityTopList"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Get the stored tracks with highest popularity.", tag) .WithRequestParameter("date", description: "Specify date, if not specified today is used.", required: false, loc: "query") .WithDefaultResponse>()); } } }