using System.Collections.Generic; using System.Linq; using Nancy.Metadata.Modules; using Nancy.Metadata.Swagger.Core; using Nancy.Metadata.Swagger.Fluent; using Sony.Filtr.AdminAPI.ViewModels.AppleMusic.Chart; using Sony.Filtr.AppleMusic.Data; namespace Sony.Filtr.AdminAPI.Modules.AppleMusic { public class AppleMusicChartsMetadataModule : MetadataModule { public AppleMusicChartsMetadataModule() { const string tag = "Apple Music charts"; Describe["AppleMusicChartsForTrack"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Get a summary for the chart status in all countries for the specified.", tag) .WithRequestParameter("isrc", type: "string", description: "ISRC of track", loc: "query", required: true) .WithDefaultResponse>>() ); Describe["AppleMusicAvailableCharts"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Get all stored charts for the given combination of search parameters.", tag) .WithRequestParameter("country", type: "string", description: "Only include charts for the specified country", loc: "query", required: false) .WithRequestParameter("date", type: "string", description: "Only include charts for the specified date", loc: "query", required: false) .WithRequestParameter("chartType", type: "string", description: "Only include charts for the specified chartType. Possible values: Songs, Albums, MusicVideos.", loc: "query", required: false) .WithRequestParameter("chartName", type: "string", description: "Only include charts for the specified chartName. Currently only 'most-played'.", loc: "query", required: false) .WithRequestParameter("genreId", type: "string", description: "Only include charts for the specified genreId. Specify 'null' for non-genre charts.", loc: "query", required: false) .WithDefaultResponse>() ); Describe["AppleMusicChartGenres"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Get all chart genres.", tag) .WithRequestParameter("country", type: "string", description: "Only include charts genres for the specified country", loc: "query", required: false) .WithDefaultResponse>() ); Describe["AppleMusicChartEntriesById"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Get the content of a specific chart. Result can be either albums, musicvideos or songs based on the chart.", tag) .WithRequestParameter("chartId", type: "string", description: "Id of the chart", loc: "path", required: true) .WithDefaultResponse() ); Describe["AppleMusicLatestMostPlayedSongChart"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Get the chart entries for the most played songs.", tag) .WithRequestParameter("country", type: "string", description: "Only include charts for the specified country", loc: "query", required: false) .WithDefaultResponse>() ); } } }