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 TagCategoryMetadataModule : MetadataModule { public TagCategoryMetadataModule() { var tag = "Tag Category"; Describe["GetTagCategories"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Get all available tag categories", tag) .WithDefaultResponse>()); Describe["AddTagCategory"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Add a new tag category", tag) .WithRequestModel() .WithDefaultResponse() .WithResponse(HttpStatusCode.BadRequest, "Missing or invalid request parameter")); Describe["GetSingleTagCategory"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Get the specified tag category", tag) .WithRequestParameter("id", description: "Tag category id") .WithDefaultResponse() .WithResponse(HttpStatusCode.BadRequest, "Missing or invalid request parameter") .WithResponse(HttpStatusCode.NotFound, "Specified tag category id could not be found")); Describe["UpdateTagCategory"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Update an existing tag category", tag) .WithRequestParameter("id", description: "Tag category id") .WithRequestModel() .WithDefaultResponse() .WithResponse(HttpStatusCode.BadRequest, "Missing or invalid request parameter") .WithResponse(HttpStatusCode.NotFound, "Specified tag category id could not be found")); Describe["DeleteTagCategory"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Delete an existing tag category", tag) .WithRequestParameter("id", description: "Tag category id") .WithResponse(HttpStatusCode.NoContent, "The tag category has been removed") .WithResponse(HttpStatusCode.BadRequest, "Missing or invalid request parameter") .WithResponse(HttpStatusCode.NotFound, "Specified tag category id could not be found")); } } }