//------------------------------------------------------------------------------
// <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>
    /// XcmpQueueController controller to access storages.
    /// </summary>
    [ApiController()]
    [Route("[controller]")]
    public sealed class XcmpQueueController : ControllerBase
    {
        
        private IXcmpQueueStorage _xcmpQueueStorage;
        
        /// <summary>
        /// XcmpQueueController constructor.
        /// </summary>
        public XcmpQueueController(IXcmpQueueStorage xcmpQueueStorage)
        {
            _xcmpQueueStorage = xcmpQueueStorage;
        }
        
        /// <summary>
        /// >> InboundXcmpStatus
        ///  Status of the inbound XCMP channels.
        /// </summary>
        [HttpGet("InboundXcmpStatus")]
        [ProducesResponseType(typeof(Ajuna.NetApi.Model.Types.Base.BaseVec<Bajun.Network.NET.NetApiExt.Generated.Model.cumulus_pallet_xcmp_queue.InboundChannelDetails>), 200)]
        [StorageKeyBuilder(typeof(Bajun.Network.NET.NetApiExt.Generated.Storage.XcmpQueueStorage), "InboundXcmpStatusParams")]
        public IActionResult GetInboundXcmpStatus()
        {
            return this.Ok(_xcmpQueueStorage.GetInboundXcmpStatus());
        }
        
        /// <summary>
        /// >> InboundXcmpMessages
        ///  Inbound aggregate XCMP messages. It can only be one per ParaId/block.
        /// </summary>
        [HttpGet("InboundXcmpMessages")]
        [ProducesResponseType(typeof(Ajuna.NetApi.Model.Types.Base.BaseVec<Ajuna.NetApi.Model.Types.Primitive.U8>), 200)]
        [StorageKeyBuilder(typeof(Bajun.Network.NET.NetApiExt.Generated.Storage.XcmpQueueStorage), "InboundXcmpMessagesParams", typeof(Ajuna.NetApi.Model.Types.Base.BaseTuple<Bajun.Network.NET.NetApiExt.Generated.Model.polkadot_parachain.primitives.Id, Ajuna.NetApi.Model.Types.Primitive.U32>))]
        public IActionResult GetInboundXcmpMessages(string key)
        {
            return this.Ok(_xcmpQueueStorage.GetInboundXcmpMessages(key));
        }
        
        /// <summary>
        /// >> OutboundXcmpStatus
        ///  The non-empty XCMP channels in order of becoming non-empty, and the index of the first
        ///  and last outbound message. If the two indices are equal, then it indicates an empty
        ///  queue and there must be a non-`Ok` `OutboundStatus`. We assume queues grow no greater
        ///  than 65535 items. Queue indices for normal messages begin at one; zero is reserved in
        ///  case of the need to send a high-priority signal message this block.
        ///  The bool is true if there is a signal message waiting to be sent.
        /// </summary>
        [HttpGet("OutboundXcmpStatus")]
        [ProducesResponseType(typeof(Ajuna.NetApi.Model.Types.Base.BaseVec<Bajun.Network.NET.NetApiExt.Generated.Model.cumulus_pallet_xcmp_queue.OutboundChannelDetails>), 200)]
        [StorageKeyBuilder(typeof(Bajun.Network.NET.NetApiExt.Generated.Storage.XcmpQueueStorage), "OutboundXcmpStatusParams")]
        public IActionResult GetOutboundXcmpStatus()
        {
            return this.Ok(_xcmpQueueStorage.GetOutboundXcmpStatus());
        }
        
        /// <summary>
        /// >> OutboundXcmpMessages
        ///  The messages outbound in a given XCMP channel.
        /// </summary>
        [HttpGet("OutboundXcmpMessages")]
        [ProducesResponseType(typeof(Ajuna.NetApi.Model.Types.Base.BaseVec<Ajuna.NetApi.Model.Types.Primitive.U8>), 200)]
        [StorageKeyBuilder(typeof(Bajun.Network.NET.NetApiExt.Generated.Storage.XcmpQueueStorage), "OutboundXcmpMessagesParams", typeof(Ajuna.NetApi.Model.Types.Base.BaseTuple<Bajun.Network.NET.NetApiExt.Generated.Model.polkadot_parachain.primitives.Id, Ajuna.NetApi.Model.Types.Primitive.U16>))]
        public IActionResult GetOutboundXcmpMessages(string key)
        {
            return this.Ok(_xcmpQueueStorage.GetOutboundXcmpMessages(key));
        }
        
        /// <summary>
        /// >> SignalMessages
        ///  Any signal messages waiting to be sent.
        /// </summary>
        [HttpGet("SignalMessages")]
        [ProducesResponseType(typeof(Ajuna.NetApi.Model.Types.Base.BaseVec<Ajuna.NetApi.Model.Types.Primitive.U8>), 200)]
        [StorageKeyBuilder(typeof(Bajun.Network.NET.NetApiExt.Generated.Storage.XcmpQueueStorage), "SignalMessagesParams", typeof(Bajun.Network.NET.NetApiExt.Generated.Model.polkadot_parachain.primitives.Id))]
        public IActionResult GetSignalMessages(string key)
        {
            return this.Ok(_xcmpQueueStorage.GetSignalMessages(key));
        }
        
        /// <summary>
        /// >> QueueConfig
        ///  The configuration which controls the dynamics of the outbound queue.
        /// </summary>
        [HttpGet("QueueConfig")]
        [ProducesResponseType(typeof(Bajun.Network.NET.NetApiExt.Generated.Model.cumulus_pallet_xcmp_queue.QueueConfigData), 200)]
        [StorageKeyBuilder(typeof(Bajun.Network.NET.NetApiExt.Generated.Storage.XcmpQueueStorage), "QueueConfigParams")]
        public IActionResult GetQueueConfig()
        {
            return this.Ok(_xcmpQueueStorage.GetQueueConfig());
        }
        
        /// <summary>
        /// >> Overweight
        ///  The messages that exceeded max individual message weight budget.
        /// 
        ///  These message stay in this storage map until they are manually dispatched via
        ///  `service_overweight`.
        /// </summary>
        [HttpGet("Overweight")]
        [ProducesResponseType(typeof(Ajuna.NetApi.Model.Types.Base.BaseTuple<Bajun.Network.NET.NetApiExt.Generated.Model.polkadot_parachain.primitives.Id, Ajuna.NetApi.Model.Types.Primitive.U32, Ajuna.NetApi.Model.Types.Base.BaseVec<Ajuna.NetApi.Model.Types.Primitive.U8>>), 200)]
        [StorageKeyBuilder(typeof(Bajun.Network.NET.NetApiExt.Generated.Storage.XcmpQueueStorage), "OverweightParams", typeof(Ajuna.NetApi.Model.Types.Primitive.U64))]
        public IActionResult GetOverweight(string key)
        {
            return this.Ok(_xcmpQueueStorage.GetOverweight(key));
        }
        
        /// <summary>
        /// >> OverweightCount
        ///  The number of overweight messages ever recorded in `Overweight`. Also doubles as the next
        ///  available free overweight index.
        /// </summary>
        [HttpGet("OverweightCount")]
        [ProducesResponseType(typeof(Ajuna.NetApi.Model.Types.Primitive.U64), 200)]
        [StorageKeyBuilder(typeof(Bajun.Network.NET.NetApiExt.Generated.Storage.XcmpQueueStorage), "OverweightCountParams")]
        public IActionResult GetOverweightCount()
        {
            return this.Ok(_xcmpQueueStorage.GetOverweightCount());
        }
        
        /// <summary>
        /// >> QueueSuspended
        ///  Whether or not the XCMP queue is suspended from executing incoming XCMs or not.
        /// </summary>
        [HttpGet("QueueSuspended")]
        [ProducesResponseType(typeof(Ajuna.NetApi.Model.Types.Primitive.Bool), 200)]
        [StorageKeyBuilder(typeof(Bajun.Network.NET.NetApiExt.Generated.Storage.XcmpQueueStorage), "QueueSuspendedParams")]
        public IActionResult GetQueueSuspended()
        {
            return this.Ok(_xcmpQueueStorage.GetQueueSuspended());
        }
    }
}
