//------------------------------------------------------------------------------
// <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.Attributes;
using Ajuna.NetApi.Model.Types.Base;
using Ajuna.NetApi.Model.Types.Metadata.V14;
using System.Collections.Generic;


namespace Bajun.Network.NET.NetApiExt.Generated.Model.cumulus_pallet_xcmp_queue
{
    
    
    /// <summary>
    /// >> 384 - Composite[cumulus_pallet_xcmp_queue.InboundChannelDetails]
    /// </summary>
    [AjunaNodeType(TypeDefEnum.Composite)]
    public sealed class InboundChannelDetails : BaseType
    {
        
        /// <summary>
        /// >> sender
        /// </summary>
        private Bajun.Network.NET.NetApiExt.Generated.Model.polkadot_parachain.primitives.Id _sender;
        
        /// <summary>
        /// >> state
        /// </summary>
        private Bajun.Network.NET.NetApiExt.Generated.Model.cumulus_pallet_xcmp_queue.EnumInboundState _state;
        
        /// <summary>
        /// >> message_metadata
        /// </summary>
        private Ajuna.NetApi.Model.Types.Base.BaseVec<Ajuna.NetApi.Model.Types.Base.BaseTuple<Ajuna.NetApi.Model.Types.Primitive.U32, Bajun.Network.NET.NetApiExt.Generated.Model.polkadot_parachain.primitives.EnumXcmpMessageFormat>> _messageMetadata;
        
        public Bajun.Network.NET.NetApiExt.Generated.Model.polkadot_parachain.primitives.Id Sender
        {
            get
            {
                return this._sender;
            }
            set
            {
                this._sender = value;
            }
        }
        
        public Bajun.Network.NET.NetApiExt.Generated.Model.cumulus_pallet_xcmp_queue.EnumInboundState State
        {
            get
            {
                return this._state;
            }
            set
            {
                this._state = value;
            }
        }
        
        public Ajuna.NetApi.Model.Types.Base.BaseVec<Ajuna.NetApi.Model.Types.Base.BaseTuple<Ajuna.NetApi.Model.Types.Primitive.U32, Bajun.Network.NET.NetApiExt.Generated.Model.polkadot_parachain.primitives.EnumXcmpMessageFormat>> MessageMetadata
        {
            get
            {
                return this._messageMetadata;
            }
            set
            {
                this._messageMetadata = value;
            }
        }
        
        public override string TypeName()
        {
            return "InboundChannelDetails";
        }
        
        public override byte[] Encode()
        {
            var result = new List<byte>();
            result.AddRange(Sender.Encode());
            result.AddRange(State.Encode());
            result.AddRange(MessageMetadata.Encode());
            return result.ToArray();
        }
        
        public override void Decode(byte[] byteArray, ref int p)
        {
            var start = p;
            Sender = new Bajun.Network.NET.NetApiExt.Generated.Model.polkadot_parachain.primitives.Id();
            Sender.Decode(byteArray, ref p);
            State = new Bajun.Network.NET.NetApiExt.Generated.Model.cumulus_pallet_xcmp_queue.EnumInboundState();
            State.Decode(byteArray, ref p);
            MessageMetadata = new Ajuna.NetApi.Model.Types.Base.BaseVec<Ajuna.NetApi.Model.Types.Base.BaseTuple<Ajuna.NetApi.Model.Types.Primitive.U32, Bajun.Network.NET.NetApiExt.Generated.Model.polkadot_parachain.primitives.EnumXcmpMessageFormat>>();
            MessageMetadata.Decode(byteArray, ref p);
            TypeSize = p - start;
        }
    }
}
