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.Buzz; using Sony.Filtr.Core.Buzz; namespace Sony.Filtr.AdminAPI.Modules.Buzz { public class BuzzArtistMetadataModule : MetadataModule { public BuzzArtistMetadataModule() { const string tag = "Buzz Artist"; Describe["GetBuzzArtists"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Get all artist in Buzz.", tag) .WithDefaultResponse>() ); Describe["AddBuzzArtist"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Add a new artist to buzz tracking.", tag) .WithRequestModel(description: "An object with the ArtistUri of the artist to add") .WithResponse(HttpStatusCode.BadRequest, "If no valid artist specified or artist can not be found in Spotify") .WithResponse(HttpStatusCode.Conflict, "Artist has already been added") .WithDefaultResponse() ); Describe["UpdateBuzzArtist"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Update an existing artist with another username", tag) .WithRequestParameter("id", type: "integer", description: "Id of the existing artist") .WithRequestModel(description: "An artist with the desired ArtistSpotifyUserName") .WithDefaultResponse() .WithResponse(HttpStatusCode.NotFound, "If the specified artist can not be found") .WithResponse(HttpStatusCode.BadRequest, "If no valid artist id is specified") ); Describe["DeleteBuzzArtist"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Add a new group in the specified category", tag) .WithRequestParameter("id", type: "integer", description: "Id of the existing artist") .WithResponse(HttpStatusCode.NoContent, "Artist has been deleted") .WithResponse(HttpStatusCode.NotFound, "If the specified artist can not be found") .WithResponse(HttpStatusCode.BadRequest, "If missing valid artist id parameter")); Describe["GetBuzzArtistPlaylist"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Get the playlists for the artist", tag) .WithRequestParameter("id", type: "integer", description: "Id of the existing artist") .WithDefaultResponse>() .WithResponse(HttpStatusCode.BadRequest, "If missing valid artist id parameter")); Describe["GetBuzzArtistSpotifyFollowers"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Get spotify playlists followers for the artist playlists.", tag) .WithRequestParameter("artistId", type: "integer", description: "Id of the existing artist") .WithRequestParameter("startDate", type: "string", description: "Start date, if missing from 30 days ago", required: false) .WithRequestParameter("endDate", type: "string", description: "End date", required: false) .WithDefaultResponse>() .WithResponse(HttpStatusCode.BadRequest, "If missing valid artist id parameter")); } } }