//------------------------------------------------------------------------------
// <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_nfts.types
{
    
    
    /// <summary>
    /// >> 293 - Composite[pallet_nfts.types.CollectionConfig]
    /// </summary>
    [AjunaNodeType(TypeDefEnum.Composite)]
    public sealed class CollectionConfig : BaseType
    {
        
        /// <summary>
        /// >> settings
        /// </summary>
        private Bajun.Network.NET.NetApiExt.Generated.Model.pallet_nfts.types.BitFlagsT1 _settings;
        
        /// <summary>
        /// >> max_supply
        /// </summary>
        private Ajuna.NetApi.Model.Types.Base.BaseOpt<Ajuna.NetApi.Model.Types.Primitive.U32> _maxSupply;
        
        /// <summary>
        /// >> mint_settings
        /// </summary>
        private Bajun.Network.NET.NetApiExt.Generated.Model.pallet_nfts.types.MintSettings _mintSettings;
        
        public Bajun.Network.NET.NetApiExt.Generated.Model.pallet_nfts.types.BitFlagsT1 Settings
        {
            get
            {
                return this._settings;
            }
            set
            {
                this._settings = value;
            }
        }
        
        public Ajuna.NetApi.Model.Types.Base.BaseOpt<Ajuna.NetApi.Model.Types.Primitive.U32> MaxSupply
        {
            get
            {
                return this._maxSupply;
            }
            set
            {
                this._maxSupply = value;
            }
        }
        
        public Bajun.Network.NET.NetApiExt.Generated.Model.pallet_nfts.types.MintSettings MintSettings
        {
            get
            {
                return this._mintSettings;
            }
            set
            {
                this._mintSettings = value;
            }
        }
        
        public override string TypeName()
        {
            return "CollectionConfig";
        }
        
        public override byte[] Encode()
        {
            var result = new List<byte>();
            result.AddRange(Settings.Encode());
            result.AddRange(MaxSupply.Encode());
            result.AddRange(MintSettings.Encode());
            return result.ToArray();
        }
        
        public override void Decode(byte[] byteArray, ref int p)
        {
            var start = p;
            Settings = new Bajun.Network.NET.NetApiExt.Generated.Model.pallet_nfts.types.BitFlagsT1();
            Settings.Decode(byteArray, ref p);
            MaxSupply = new Ajuna.NetApi.Model.Types.Base.BaseOpt<Ajuna.NetApi.Model.Types.Primitive.U32>();
            MaxSupply.Decode(byteArray, ref p);
            MintSettings = new Bajun.Network.NET.NetApiExt.Generated.Model.pallet_nfts.types.MintSettings();
            MintSettings.Decode(byteArray, ref p);
            TypeSize = p - start;
        }
    }
}
