//------------------------------------------------------------------------------
// <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 Ajuna.ServiceLayer.Storage;
using System.Collections.Generic;
using System.Threading.Tasks;


namespace Bajun.Network.NET.RestService.Generated.Storage
{
    
    
    /// <summary>
    /// INftTransferStorage interface definition.
    /// </summary>
    public interface INftTransferStorage : IStorage
    {
        
        /// <summary>
        /// >> Organizer
        /// </summary>
        Bajun.Network.NET.NetApiExt.Generated.Model.sp_core.crypto.AccountId32 GetOrganizer();
        
        /// <summary>
        /// >> LockedState
        /// </summary>
        Bajun.Network.NET.NetApiExt.Generated.Model.pallet_ajuna_nft_transfer.pallet.EnumPalletLockedState GetLockedState();
        
        /// <summary>
        /// >> NextItemId
        /// </summary>
        Ajuna.NetApi.Model.Types.Primitive.U128 GetNextItemId(string key);
        
        /// <summary>
        /// >> LockItemStatus
        /// </summary>
        Bajun.Network.NET.NetApiExt.Generated.Model.pallet_ajuna_nft_transfer.pallet.EnumNftStatus GetLockItemStatus(string key);
        
        /// <summary>
        /// >> HoldingAccount
        /// </summary>
        Bajun.Network.NET.NetApiExt.Generated.Model.sp_core.crypto.AccountId32 GetHoldingAccount();
        
        /// <summary>
        /// >> NftClaimants
        /// </summary>
        Bajun.Network.NET.NetApiExt.Generated.Model.sp_core.crypto.AccountId32 GetNftClaimants(string key);
    }
    
    /// <summary>
    /// NftTransferStorage class definition.
    /// </summary>
    public sealed class NftTransferStorage : INftTransferStorage
    {
        
        /// <summary>
        /// _organizerTypedStorage typed storage field
        /// </summary>
        private TypedStorage<Bajun.Network.NET.NetApiExt.Generated.Model.sp_core.crypto.AccountId32> _organizerTypedStorage;
        
        /// <summary>
        /// _lockedStateTypedStorage typed storage field
        /// </summary>
        private TypedStorage<Bajun.Network.NET.NetApiExt.Generated.Model.pallet_ajuna_nft_transfer.pallet.EnumPalletLockedState> _lockedStateTypedStorage;
        
        /// <summary>
        /// _nextItemIdTypedStorage typed storage field
        /// </summary>
        private TypedMapStorage<Ajuna.NetApi.Model.Types.Primitive.U128> _nextItemIdTypedStorage;
        
        /// <summary>
        /// _lockItemStatusTypedStorage typed storage field
        /// </summary>
        private TypedMapStorage<Bajun.Network.NET.NetApiExt.Generated.Model.pallet_ajuna_nft_transfer.pallet.EnumNftStatus> _lockItemStatusTypedStorage;
        
        /// <summary>
        /// _holdingAccountTypedStorage typed storage field
        /// </summary>
        private TypedStorage<Bajun.Network.NET.NetApiExt.Generated.Model.sp_core.crypto.AccountId32> _holdingAccountTypedStorage;
        
        /// <summary>
        /// _nftClaimantsTypedStorage typed storage field
        /// </summary>
        private TypedMapStorage<Bajun.Network.NET.NetApiExt.Generated.Model.sp_core.crypto.AccountId32> _nftClaimantsTypedStorage;
        
        /// <summary>
        /// NftTransferStorage constructor.
        /// </summary>
        public NftTransferStorage(IStorageDataProvider storageDataProvider, List<IStorageChangeDelegate> storageChangeDelegates)
        {
            this.OrganizerTypedStorage = new TypedStorage<Bajun.Network.NET.NetApiExt.Generated.Model.sp_core.crypto.AccountId32>("NftTransfer.Organizer", storageDataProvider, storageChangeDelegates);
            this.LockedStateTypedStorage = new TypedStorage<Bajun.Network.NET.NetApiExt.Generated.Model.pallet_ajuna_nft_transfer.pallet.EnumPalletLockedState>("NftTransfer.LockedState", storageDataProvider, storageChangeDelegates);
            this.NextItemIdTypedStorage = new TypedMapStorage<Ajuna.NetApi.Model.Types.Primitive.U128>("NftTransfer.NextItemId", storageDataProvider, storageChangeDelegates);
            this.LockItemStatusTypedStorage = new TypedMapStorage<Bajun.Network.NET.NetApiExt.Generated.Model.pallet_ajuna_nft_transfer.pallet.EnumNftStatus>("NftTransfer.LockItemStatus", storageDataProvider, storageChangeDelegates);
            this.HoldingAccountTypedStorage = new TypedStorage<Bajun.Network.NET.NetApiExt.Generated.Model.sp_core.crypto.AccountId32>("NftTransfer.HoldingAccount", storageDataProvider, storageChangeDelegates);
            this.NftClaimantsTypedStorage = new TypedMapStorage<Bajun.Network.NET.NetApiExt.Generated.Model.sp_core.crypto.AccountId32>("NftTransfer.NftClaimants", storageDataProvider, storageChangeDelegates);
        }
        
        /// <summary>
        /// _organizerTypedStorage property
        /// </summary>
        public TypedStorage<Bajun.Network.NET.NetApiExt.Generated.Model.sp_core.crypto.AccountId32> OrganizerTypedStorage
        {
            get
            {
                return _organizerTypedStorage;
            }
            set
            {
                _organizerTypedStorage = value;
            }
        }
        
        /// <summary>
        /// _lockedStateTypedStorage property
        /// </summary>
        public TypedStorage<Bajun.Network.NET.NetApiExt.Generated.Model.pallet_ajuna_nft_transfer.pallet.EnumPalletLockedState> LockedStateTypedStorage
        {
            get
            {
                return _lockedStateTypedStorage;
            }
            set
            {
                _lockedStateTypedStorage = value;
            }
        }
        
        /// <summary>
        /// _nextItemIdTypedStorage property
        /// </summary>
        public TypedMapStorage<Ajuna.NetApi.Model.Types.Primitive.U128> NextItemIdTypedStorage
        {
            get
            {
                return _nextItemIdTypedStorage;
            }
            set
            {
                _nextItemIdTypedStorage = value;
            }
        }
        
        /// <summary>
        /// _lockItemStatusTypedStorage property
        /// </summary>
        public TypedMapStorage<Bajun.Network.NET.NetApiExt.Generated.Model.pallet_ajuna_nft_transfer.pallet.EnumNftStatus> LockItemStatusTypedStorage
        {
            get
            {
                return _lockItemStatusTypedStorage;
            }
            set
            {
                _lockItemStatusTypedStorage = value;
            }
        }
        
        /// <summary>
        /// _holdingAccountTypedStorage property
        /// </summary>
        public TypedStorage<Bajun.Network.NET.NetApiExt.Generated.Model.sp_core.crypto.AccountId32> HoldingAccountTypedStorage
        {
            get
            {
                return _holdingAccountTypedStorage;
            }
            set
            {
                _holdingAccountTypedStorage = value;
            }
        }
        
        /// <summary>
        /// _nftClaimantsTypedStorage property
        /// </summary>
        public TypedMapStorage<Bajun.Network.NET.NetApiExt.Generated.Model.sp_core.crypto.AccountId32> NftClaimantsTypedStorage
        {
            get
            {
                return _nftClaimantsTypedStorage;
            }
            set
            {
                _nftClaimantsTypedStorage = value;
            }
        }
        
        /// <summary>
        /// Connects to all storages and initializes the change subscription handling.
        /// </summary>
        public async Task InitializeAsync(Ajuna.ServiceLayer.Storage.IStorageDataProvider dataProvider)
        {
            await OrganizerTypedStorage.InitializeAsync("NftTransfer", "Organizer");
            await LockedStateTypedStorage.InitializeAsync("NftTransfer", "LockedState");
            await NextItemIdTypedStorage.InitializeAsync("NftTransfer", "NextItemId");
            await LockItemStatusTypedStorage.InitializeAsync("NftTransfer", "LockItemStatus");
            await HoldingAccountTypedStorage.InitializeAsync("NftTransfer", "HoldingAccount");
            await NftClaimantsTypedStorage.InitializeAsync("NftTransfer", "NftClaimants");
        }
        
        /// <summary>
        /// Implements any storage change for NftTransfer.Organizer
        /// </summary>
        [StorageChange("NftTransfer", "Organizer")]
        public void OnUpdateOrganizer(string data)
        {
            OrganizerTypedStorage.Update(data);
        }
        
        /// <summary>
        /// >> Organizer
        /// </summary>
        public Bajun.Network.NET.NetApiExt.Generated.Model.sp_core.crypto.AccountId32 GetOrganizer()
        {
            return OrganizerTypedStorage.Get();
        }
        
        /// <summary>
        /// Implements any storage change for NftTransfer.LockedState
        /// </summary>
        [StorageChange("NftTransfer", "LockedState")]
        public void OnUpdateLockedState(string data)
        {
            LockedStateTypedStorage.Update(data);
        }
        
        /// <summary>
        /// >> LockedState
        /// </summary>
        public Bajun.Network.NET.NetApiExt.Generated.Model.pallet_ajuna_nft_transfer.pallet.EnumPalletLockedState GetLockedState()
        {
            return LockedStateTypedStorage.Get();
        }
        
        /// <summary>
        /// Implements any storage change for NftTransfer.NextItemId
        /// </summary>
        [StorageChange("NftTransfer", "NextItemId")]
        public void OnUpdateNextItemId(string key, string data)
        {
            NextItemIdTypedStorage.Update(key, data);
        }
        
        /// <summary>
        /// >> NextItemId
        /// </summary>
        public Ajuna.NetApi.Model.Types.Primitive.U128 GetNextItemId(string key)
        {
            if ((key == null))
            {
                return null;
            }
            if (NextItemIdTypedStorage.Dictionary.TryGetValue(key, out Ajuna.NetApi.Model.Types.Primitive.U128 result))
            {
                return result;
            }
            else
            {
                return null;
            }
        }
        
        /// <summary>
        /// Implements any storage change for NftTransfer.LockItemStatus
        /// </summary>
        [StorageChange("NftTransfer", "LockItemStatus")]
        public void OnUpdateLockItemStatus(string key, string data)
        {
            LockItemStatusTypedStorage.Update(key, data);
        }
        
        /// <summary>
        /// >> LockItemStatus
        /// </summary>
        public Bajun.Network.NET.NetApiExt.Generated.Model.pallet_ajuna_nft_transfer.pallet.EnumNftStatus GetLockItemStatus(string key)
        {
            if ((key == null))
            {
                return null;
            }
            if (LockItemStatusTypedStorage.Dictionary.TryGetValue(key, out Bajun.Network.NET.NetApiExt.Generated.Model.pallet_ajuna_nft_transfer.pallet.EnumNftStatus result))
            {
                return result;
            }
            else
            {
                return null;
            }
        }
        
        /// <summary>
        /// Implements any storage change for NftTransfer.HoldingAccount
        /// </summary>
        [StorageChange("NftTransfer", "HoldingAccount")]
        public void OnUpdateHoldingAccount(string data)
        {
            HoldingAccountTypedStorage.Update(data);
        }
        
        /// <summary>
        /// >> HoldingAccount
        /// </summary>
        public Bajun.Network.NET.NetApiExt.Generated.Model.sp_core.crypto.AccountId32 GetHoldingAccount()
        {
            return HoldingAccountTypedStorage.Get();
        }
        
        /// <summary>
        /// Implements any storage change for NftTransfer.NftClaimants
        /// </summary>
        [StorageChange("NftTransfer", "NftClaimants")]
        public void OnUpdateNftClaimants(string key, string data)
        {
            NftClaimantsTypedStorage.Update(key, data);
        }
        
        /// <summary>
        /// >> NftClaimants
        /// </summary>
        public Bajun.Network.NET.NetApiExt.Generated.Model.sp_core.crypto.AccountId32 GetNftClaimants(string key)
        {
            if ((key == null))
            {
                return null;
            }
            if (NftClaimantsTypedStorage.Dictionary.TryGetValue(key, out Bajun.Network.NET.NetApiExt.Generated.Model.sp_core.crypto.AccountId32 result))
            {
                return result;
            }
            else
            {
                return null;
            }
        }
    }
}
