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.Buzz { public class BuzzPlaylistMetadataModule : MetadataModule { public BuzzPlaylistMetadataModule() { const string tag = "Buzz Playlists"; Describe["GetBuzzPlaylists"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Get the playlists for the specified buzz user.", tag) .WithRequestParameter("buzzId", description: "Id of buzz user") .WithDefaultResponse>() .WithResponse(HttpStatusCode.BadRequest, "If missing or invalid buzz user id") ); Describe["GetBuzzPlaylistExcel"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Get the playlists for the specified buzz user in CSV-format.", tag) .WithRequestParameter("buzzId", description: "Id of buzz user") .WithResponse(HttpStatusCode.OK, "CSV-file containing the playlists") .WithResponse(HttpStatusCode.BadRequest, "If missing or invalid buzz user id") ); Describe["GetBuzzPlaylistForCompanyInMarket"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Get buzz playlists for the specified company id", tag) .WithRequestParameter("countryCode", type: "string", description: "Market id or countryCode") .WithRequestParameter("companyId", type: "string", description: "Id of the buzz company artist") .WithDefaultResponse>() .WithResponse(HttpStatusCode.NotFound, "If the specified buzz company id can not be found") ); Describe["GetBuzzPlaylistForCompanyInMarketExcel"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Get buzz playlists for the specified company id in CSV-format", tag) .WithRequestParameter("countryCode", type: "string", description: "Market id or countryCode") .WithRequestParameter("companyId", type: "string", description: "Id of the buzz company artist") .WithResponse(HttpStatusCode.OK, "CSV-file containing the playlists") .WithResponse(HttpStatusCode.NotFound, "If the specified artist can not be found") ); Describe["GetBuzzPlaylistForCompany"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Get buzz playlists for the specified company id", tag) .WithRequestParameter("companyId", type: "string", description: "Id of the buzz company artist") .WithDefaultResponse>() .WithResponse(HttpStatusCode.NotFound, "If the specified buzz company id can not be found") ); Describe["GetBuzzPlaylistForCompanyExcel"] = description => new SwaggerRouteMetadata(description).With(c => c.WithDescription("Get buzz playlists for the specified company id in CSV-format", tag) .WithRequestParameter("companyId", type: "string", description: "Id of the buzz company artist") .WithResponse(HttpStatusCode.OK, "CSV-file containing the playlists") .WithResponse(HttpStatusCode.NotFound, "If the specified artist can not be found") ); } } }