using System.Collections.Generic; using Nancy; using Nancy.Metadata.Modules; using Nancy.Metadata.Swagger.Core; using Nancy.Metadata.Swagger.Fluent; using Sony.Filtr.Contracts.Entities; namespace Sony.Filtr.AdminAPI.Modules.SonyTracks { public class SonyTracksMetadataModule : MetadataModule { public SonyTracksMetadataModule() { var tag = "IsSony"; Describe["IsAlbumSony"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Check if albums are by Sony.", "Is Sony") .WithRequestParameter("upc", description: "Upc of the albums to check. Possible to send multiple via comma or multiple parameters.", loc: "query") .WithRequestParameter("market", description: "Market used to check IsSony. ", loc: "query") .WithDefaultResponse>()); Describe["GetISRCOverrides"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Gets all existing ISRC overrides for manually overriding UPC-based \"Is sony\"", "Is Sony") .WithDefaultResponse>>()); Describe["SetISRCoverride"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Sets an ISRC override for a specific ISRC for one or many countries, or globally.", "Is Sony") .WithRequestParameter("ISRC", description: "ISRC to set override for") .WithRequestParameter("isSony", description: "Sets value of \"is Sony\" for specified ISRC", loc: "query") .WithRequestParameter("countryCodes", description: "Comma-separated list of country codes to set override for (individual country overrides global)", loc: "query") .WithRequestParameter("setGlobal", description: "If true, sets a global override for all countries (as well as for unspecified market)", loc: "query") .WithResponse(HttpStatusCode.Accepted, "Isrc override has been added to database.")); Describe["RemoveISRCoverride"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Removes an ISRC override for a specific ISRC for one or many countries, or globally.", "Is Sony") .WithRequestParameter("ISRC", description: "ISRC to remove override for") .WithRequestParameter("countryCodes", description: "Comma-separated list of country codes to remove override for (individual country overrides global)", loc: "query") .WithRequestParameter("removeGlobal", description: "If true, removes the global override for all countries", loc: "query") .WithRequestParameter("removeAll", description: "If true, ignores countryCodes and removeGlobal parameters and removes all override entries for the specified ISRC", loc: "query") .WithResponse(HttpStatusCode.Accepted, "Isrc override has been removed from database.")); } } }