using System.Collections.Generic; using System.Linq; using Nancy; using Nancy.Metadata.Modules; using Nancy.Metadata.Swagger.Core; using Nancy.Metadata.Swagger.Fluent; using Nancy.ModelBinding; using Sony.Filtr.ApiConsumer; using Sony.Filtr.Contracts.Abstractions; using Sony.Filtr.Contracts.Entities; namespace Sony.Filtr.AdminAPI.Modules { public class BlacklistMetadataModule : MetadataModule { public BlacklistMetadataModule() { const string tag = "Blacklist"; Describe["GetBlacklist"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Get the blacklisted artists", tag) .WithRequestParameter("countryCode", description: "countryCode") .WithDefaultResponse>()); Describe["AddBlackListedArtist"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Add a new blacklisted artist", tag) .WithRequestModel() .WithRequestParameter("countryCode", description: "countryCode") .WithDefaultResponse() .WithResponse(HttpStatusCode.BadRequest, "If no valid artist specified")); Describe["GetSingleBlacklistedArtist"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Get a specific blacklisted artist", tag) .WithRequestParameter("id", description: "Id of the blacklisted artist") .WithRequestParameter("countryCode", description: "countryCode") .WithDefaultResponse() .WithResponse(HttpStatusCode.BadRequest, "If no valid blacklisted artist id is specified")); Describe["UpdateBlacklistedArtist"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Update a specific blacklisted artist", tag) .WithRequestParameter("id", description: "Id of the blacklisted artist") .WithRequestParameter("countryCode", description: "countryCode") .WithRequestModel() .WithDefaultResponse() .WithResponse(HttpStatusCode.BadRequest, "If no valid blacklisted artist id is specified")); Describe["DeleteBlacklistedArtist"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Delete a specific blacklisted artist", tag) .WithRequestParameter("id", description: "Id of the blacklisted artist") .WithRequestParameter("countryCode", description: "countryCode") .WithResponse(HttpStatusCode.NoContent, "Blacklisted artist has been deleted") .WithResponse(HttpStatusCode.BadRequest, "If no valid blacklisted artist id is specified")); } } }