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.Genre; namespace Sony.Filtr.AdminAPI.Modules.PublicData { public class TagMetadataModule : MetadataModule { public TagMetadataModule() { var tag = "Tag"; Describe["GetTags"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Get all available tags in the market", tag) .WithRequestParameter("countryCode", description: "Market id") .WithDefaultResponse>()); Describe["GetSingleTag"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Get the specified tag", tag) .WithRequestParameter("genreName") .WithDefaultResponse() .WithResponse(HttpStatusCode.BadRequest, "Missing or invalid request parameter") .WithResponse(HttpStatusCode.NotFound, "No tag with specified name could be found")); Describe["UpdateTag"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Add or update the specified tag", tag) .WithRequestParameter("genreName") .WithRequestModel() .WithDefaultResponse() .WithResponse(HttpStatusCode.BadRequest, "Missing or invalid request parameter")); Describe["DeleteTag"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Delete the specified tag", tag) .WithRequestParameter("genreName") .WithResponse(HttpStatusCode.NoContent, "Tag has been removed") .WithResponse(HttpStatusCode.NotFound, "No tag with the specified name could be found")); } } }