//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

using Ajuna.NetApi.Model.Types.Base;
using Ajuna.ServiceLayer.Attributes;
using Bajun.Network.NET.RestService.Generated.Storage;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
using System.Threading.Tasks;


namespace Bajun.Network.NET.RestService.Generated.Controller
{
    
    
    /// <summary>
    /// ParachainInfoController controller to access storages.
    /// </summary>
    [ApiController()]
    [Route("[controller]")]
    public sealed class ParachainInfoController : ControllerBase
    {
        
        private IParachainInfoStorage _parachainInfoStorage;
        
        /// <summary>
        /// ParachainInfoController constructor.
        /// </summary>
        public ParachainInfoController(IParachainInfoStorage parachainInfoStorage)
        {
            _parachainInfoStorage = parachainInfoStorage;
        }
        
        /// <summary>
        /// >> ParachainId
        /// </summary>
        [HttpGet("ParachainId")]
        [ProducesResponseType(typeof(Bajun.Network.NET.NetApiExt.Generated.Model.polkadot_parachain.primitives.Id), 200)]
        [StorageKeyBuilder(typeof(Bajun.Network.NET.NetApiExt.Generated.Storage.ParachainInfoStorage), "ParachainIdParams")]
        public IActionResult GetParachainId()
        {
            return this.Ok(_parachainInfoStorage.GetParachainId());
        }
    }
}
