using System.Collections.Generic; using Nancy; using Nancy.Metadata.Modules; using Nancy.Metadata.Swagger.Core; using Nancy.Metadata.Swagger.Fluent; using Sony.Filtr.AdminAPI.ViewModels; namespace Sony.Filtr.AdminAPI.Modules.EditorialPlaylist { public class EditorialPlaylistImageMetadataModule : MetadataModule { public EditorialPlaylistImageMetadataModule() { var tag = "Playlist Images"; Describe["GetPlaylistImage"] = description => new SwaggerRouteMetadata(description).With(c=> c.WithDescription("Get the playlists image", tag) .WithRequestParameter("id") .WithResponse(HttpStatusCode.OK, "File stream with image data") .WithResponse(HttpStatusCode.BadRequest, "Invalid image id specified") .WithResponse(HttpStatusCode.NotFound, "Playlist with id is not found")); Describe["GetPlaylistImageThumbnail"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Get the playlists image thumbnail", tag) .WithRequestParameter("id") .WithResponse(HttpStatusCode.OK, "File stream with image data") .WithResponse(HttpStatusCode.BadRequest, "Invalid image id specified") .WithResponse(HttpStatusCode.NotFound, "Olaylist with id is not found")); Describe["UploadPlaylistImage"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Upload an image for the playlist", tag) .WithRequestParameter("id") .WithRequestParameter("imageData", loc: "body") .WithDefaultResponse() .WithResponse(HttpStatusCode.BadRequest, "Invalid image id specified") .WithResponse(HttpStatusCode.NotFound, "Playlist with id is not found")); Describe["GetPlaylistHeaderImage"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Get the image used as header for the playlist", tag) .WithRequestParameter("id") .WithResponse(HttpStatusCode.OK, "File stream with image data") .WithResponse(HttpStatusCode.BadRequest, "Invalid image id specified") .WithResponse(HttpStatusCode.NotFound, "Playlist with id is not found")); Describe["GetPlaylistHeaderImageThumbnail"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Get the thumbnail image used as header for the playlist", tag) .WithRequestParameter("id") .WithResponse(HttpStatusCode.OK, "File stream with image data") .WithResponse(HttpStatusCode.BadRequest, "Invalid image id specified") .WithResponse(HttpStatusCode.NotFound, "Playlist with id is not found")); Describe["UploadPlaylistHeaderImage"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Upload an header image for the playlist", tag) .WithRequestParameter("id") .WithRequestParameter("imageData", loc: "body") .WithDefaultResponse() .WithResponse(HttpStatusCode.BadRequest, "Invalid image id specified") .WithResponse(HttpStatusCode.NotFound, "Playlist with id is not found")); Describe["DeletePlaylistHeaderImage"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Delete an header image for the playlist", tag) .WithRequestParameter("id") .WithDefaultResponse()); } } }