using System;
using System.Threading.Tasks;
using Kyoo.Abstractions.Controllers;
using Kyoo.Abstractions.Models.Exceptions;
using Kyoo.Abstractions.Models.Permissions;
using Microsoft.AspNetCore.Mvc;
namespace Kyoo.Core.Api
{
///
/// An API to retrieve or edit configuration settings
///
[Route("api/config")]
[Route("api/configuration")]
[ApiController]
public class ConfigurationApi : Controller
{
///
/// The configuration manager used to retrieve and edit configuration values (while being type safe).
///
private readonly IConfigurationManager _manager;
///
/// Create a new using the given configuration.
///
/// The configuration manager used to retrieve and edit configuration values
public ConfigurationApi(IConfigurationManager manager)
{
_manager = manager;
}
///
/// Get a permission from it's slug.
///
/// The permission to retrieve. You can use ':' or "__" to get a child value.
/// The associate value or list of values.
/// Return the configuration value or the list of configurations
/// No configuration exists for the given slug
[HttpGet("{slug}")]
[Permission(nameof(ConfigurationApi), Kind.Read, Group.Admin)]
public ActionResult