mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-03-05 13:40:08 -05:00
API Annotations
This commit is contained in:
@@ -46,6 +46,7 @@ namespace Prowlarr.Api.V1.Commands
|
||||
}
|
||||
|
||||
[RestPostById]
|
||||
[Produces("application/json")]
|
||||
public ActionResult<CommandResource> StartCommand(CommandResource commandResource)
|
||||
{
|
||||
var commandType =
|
||||
@@ -69,6 +70,7 @@ namespace Prowlarr.Api.V1.Commands
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
[Produces("application/json")]
|
||||
public List<CommandResource> GetStartedCommands()
|
||||
{
|
||||
return _commandQueueManager.All().ToResource();
|
||||
|
||||
@@ -23,6 +23,7 @@ namespace Prowlarr.Api.V1.Config
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
[Produces("application/json")]
|
||||
public TResource GetConfig()
|
||||
{
|
||||
var resource = ToResource(_configService);
|
||||
@@ -32,6 +33,7 @@ namespace Prowlarr.Api.V1.Config
|
||||
}
|
||||
|
||||
[RestPutById]
|
||||
[Produces("application/json")]
|
||||
public virtual ActionResult<TResource> SaveConfig(TResource resource)
|
||||
{
|
||||
var dictionary = resource.GetType()
|
||||
|
||||
@@ -23,12 +23,14 @@ namespace Prowlarr.Api.V1.CustomFilters
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
[Produces("application/json")]
|
||||
public List<CustomFilterResource> GetCustomFilters()
|
||||
{
|
||||
return _customFilterService.All().ToResource();
|
||||
}
|
||||
|
||||
[RestPostById]
|
||||
[Produces("application/json")]
|
||||
public ActionResult<CustomFilterResource> AddCustomFilter(CustomFilterResource resource)
|
||||
{
|
||||
var customFilter = _customFilterService.Add(resource.ToModel());
|
||||
@@ -37,6 +39,7 @@ namespace Prowlarr.Api.V1.CustomFilters
|
||||
}
|
||||
|
||||
[RestPutById]
|
||||
[Produces("application/json")]
|
||||
public ActionResult<CustomFilterResource> UpdateCustomFilter(CustomFilterResource resource)
|
||||
{
|
||||
_customFilterService.Update(resource.ToModel());
|
||||
|
||||
@@ -28,6 +28,7 @@ namespace Prowlarr.Api.V1.Health
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
[Produces("application/json")]
|
||||
public List<HealthResource> GetHealth()
|
||||
{
|
||||
return _healthCheckService.Results().ToResource();
|
||||
|
||||
@@ -27,6 +27,7 @@ namespace Prowlarr.Api.V1.History
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
[Produces("application/json")]
|
||||
public PagingResource<HistoryResource> GetHistory()
|
||||
{
|
||||
var pagingResource = Request.ReadPagingResourceFromRequest<HistoryResource>();
|
||||
@@ -58,12 +59,14 @@ namespace Prowlarr.Api.V1.History
|
||||
}
|
||||
|
||||
[HttpGet("since")]
|
||||
[Produces("application/json")]
|
||||
public List<HistoryResource> GetHistorySince(DateTime date, HistoryEventType? eventType = null)
|
||||
{
|
||||
return _historyService.Since(date, eventType).Select(h => MapToResource(h)).ToList();
|
||||
}
|
||||
|
||||
[HttpGet("indexer")]
|
||||
[Produces("application/json")]
|
||||
public List<HistoryResource> GetIndexerHistory(int indexerId, HistoryEventType? eventType = null)
|
||||
{
|
||||
return _historyService.GetByIndexerId(indexerId, eventType).Select(h => MapToResource(h)).ToList();
|
||||
|
||||
@@ -22,6 +22,7 @@ namespace Prowlarr.Api.V1.Languages
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
[Produces("application/json")]
|
||||
public List<LanguageResource> GetAll()
|
||||
{
|
||||
return Language.All.Select(l => new LanguageResource
|
||||
|
||||
@@ -21,6 +21,7 @@ namespace Prowlarr.Api.V1.Localization
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
[Produces("application/json")]
|
||||
public string GetLocalizationDictionary()
|
||||
{
|
||||
return JsonSerializer.Serialize(_localizationService.GetLocalizationDictionary().ToResource(), _serializerSettings);
|
||||
|
||||
@@ -41,6 +41,7 @@ namespace Prowlarr.Api.V1
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
[Produces("application/json")]
|
||||
public List<TProviderResource> GetAll()
|
||||
{
|
||||
var providerDefinitions = _providerFactory.All().OrderBy(p => p.ImplementationName);
|
||||
@@ -58,6 +59,7 @@ namespace Prowlarr.Api.V1
|
||||
}
|
||||
|
||||
[RestPostById]
|
||||
[Produces("application/json")]
|
||||
public ActionResult<TProviderResource> CreateProvider(TProviderResource providerResource)
|
||||
{
|
||||
var providerDefinition = GetDefinition(providerResource, false);
|
||||
@@ -73,6 +75,7 @@ namespace Prowlarr.Api.V1
|
||||
}
|
||||
|
||||
[RestPutById]
|
||||
[Produces("application/json")]
|
||||
public ActionResult<TProviderResource> UpdateProvider(TProviderResource providerResource)
|
||||
{
|
||||
var providerDefinition = GetDefinition(providerResource, false);
|
||||
@@ -110,6 +113,7 @@ namespace Prowlarr.Api.V1
|
||||
}
|
||||
|
||||
[HttpGet("schema")]
|
||||
[Produces("application/json")]
|
||||
public virtual List<TProviderResource> GetTemplates()
|
||||
{
|
||||
var defaultDefinitions = _providerFactory.GetDefaultDefinitions().OrderBy(p => p.ImplementationName).ToList();
|
||||
|
||||
Reference in New Issue
Block a user