//------------------------------------------------------------------------------
// <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>
    /// >> 307 - Composite[pallet_nfts.types.ItemTip]
    /// </summary>
    [AjunaNodeType(TypeDefEnum.Composite)]
    public sealed class ItemTip : BaseType
    {
        
        /// <summary>
        /// >> collection
        /// </summary>
        private Ajuna.NetApi.Model.Types.Primitive.U32 _collection;
        
        /// <summary>
        /// >> item
        /// </summary>
        private Ajuna.NetApi.Model.Types.Primitive.U128 _item;
        
        /// <summary>
        /// >> receiver
        /// </summary>
        private Bajun.Network.NET.NetApiExt.Generated.Model.sp_core.crypto.AccountId32 _receiver;
        
        /// <summary>
        /// >> amount
        /// </summary>
        private Ajuna.NetApi.Model.Types.Primitive.U128 _amount;
        
        public Ajuna.NetApi.Model.Types.Primitive.U32 Collection
        {
            get
            {
                return this._collection;
            }
            set
            {
                this._collection = value;
            }
        }
        
        public Ajuna.NetApi.Model.Types.Primitive.U128 Item
        {
            get
            {
                return this._item;
            }
            set
            {
                this._item = value;
            }
        }
        
        public Bajun.Network.NET.NetApiExt.Generated.Model.sp_core.crypto.AccountId32 Receiver
        {
            get
            {
                return this._receiver;
            }
            set
            {
                this._receiver = value;
            }
        }
        
        public Ajuna.NetApi.Model.Types.Primitive.U128 Amount
        {
            get
            {
                return this._amount;
            }
            set
            {
                this._amount = value;
            }
        }
        
        public override string TypeName()
        {
            return "ItemTip";
        }
        
        public override byte[] Encode()
        {
            var result = new List<byte>();
            result.AddRange(Collection.Encode());
            result.AddRange(Item.Encode());
            result.AddRange(Receiver.Encode());
            result.AddRange(Amount.Encode());
            return result.ToArray();
        }
        
        public override void Decode(byte[] byteArray, ref int p)
        {
            var start = p;
            Collection = new Ajuna.NetApi.Model.Types.Primitive.U32();
            Collection.Decode(byteArray, ref p);
            Item = new Ajuna.NetApi.Model.Types.Primitive.U128();
            Item.Decode(byteArray, ref p);
            Receiver = new Bajun.Network.NET.NetApiExt.Generated.Model.sp_core.crypto.AccountId32();
            Receiver.Decode(byteArray, ref p);
            Amount = new Ajuna.NetApi.Model.Types.Primitive.U128();
            Amount.Decode(byteArray, ref p);
            TypeSize = p - start;
        }
    }
}
