//------------------------------------------------------------------------------
// <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.pallet_ajuna_awesome_avatars.types.account
{
    
    
    /// <summary>
    /// >> 420 - Composite[pallet_ajuna_awesome_avatars.types.account.AccountInfo]
    /// </summary>
    [AjunaNodeType(TypeDefEnum.Composite)]
    public sealed class AccountInfo : BaseType
    {
        
        /// <summary>
        /// >> free_mints
        /// </summary>
        private Ajuna.NetApi.Model.Types.Primitive.U16 _freeMints;
        
        /// <summary>
        /// >> storage_tier
        /// </summary>
        private Bajun.Network.NET.NetApiExt.Generated.Model.pallet_ajuna_awesome_avatars.types.account.EnumStorageTier _storageTier;
        
        /// <summary>
        /// >> stats
        /// </summary>
        private Bajun.Network.NET.NetApiExt.Generated.Model.pallet_ajuna_awesome_avatars.types.account.Stats _stats;
        
        public Ajuna.NetApi.Model.Types.Primitive.U16 FreeMints
        {
            get
            {
                return this._freeMints;
            }
            set
            {
                this._freeMints = value;
            }
        }
        
        public Bajun.Network.NET.NetApiExt.Generated.Model.pallet_ajuna_awesome_avatars.types.account.EnumStorageTier StorageTier
        {
            get
            {
                return this._storageTier;
            }
            set
            {
                this._storageTier = value;
            }
        }
        
        public Bajun.Network.NET.NetApiExt.Generated.Model.pallet_ajuna_awesome_avatars.types.account.Stats Stats
        {
            get
            {
                return this._stats;
            }
            set
            {
                this._stats = value;
            }
        }
        
        public override string TypeName()
        {
            return "AccountInfo";
        }
        
        public override byte[] Encode()
        {
            var result = new List<byte>();
            result.AddRange(FreeMints.Encode());
            result.AddRange(StorageTier.Encode());
            result.AddRange(Stats.Encode());
            return result.ToArray();
        }
        
        public override void Decode(byte[] byteArray, ref int p)
        {
            var start = p;
            FreeMints = new Ajuna.NetApi.Model.Types.Primitive.U16();
            FreeMints.Decode(byteArray, ref p);
            StorageTier = new Bajun.Network.NET.NetApiExt.Generated.Model.pallet_ajuna_awesome_avatars.types.account.EnumStorageTier();
            StorageTier.Decode(byteArray, ref p);
            Stats = new Bajun.Network.NET.NetApiExt.Generated.Model.pallet_ajuna_awesome_avatars.types.account.Stats();
            Stats.Decode(byteArray, ref p);
            TypeSize = p - start;
        }
    }
}
