//------------------------------------------------------------------------------
// <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;
using Ajuna.NetApi.Model.Extrinsics;
using Ajuna.NetApi.Model.Meta;
using Ajuna.NetApi.Model.Types;
using Ajuna.NetApi.Model.Types.Base;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;


namespace Bajun.Network.NET.NetApiExt.Generated.Storage
{
    
    
    public sealed class ParachainSystemStorage
    {
        
        // Substrate client for the storage calls.
        private SubstrateClientExt _client;
        
        public ParachainSystemStorage(SubstrateClientExt client)
        {
            this._client = client;
            _client.StorageKeyDict.Add(new System.Tuple<string, string>("ParachainSystem", "PendingValidationCode"), new System.Tuple<Ajuna.NetApi.Model.Meta.Storage.Hasher[], System.Type, System.Type>(null, null, typeof(Ajuna.NetApi.Model.Types.Base.BaseVec<Ajuna.NetApi.Model.Types.Primitive.U8>)));
            _client.StorageKeyDict.Add(new System.Tuple<string, string>("ParachainSystem", "NewValidationCode"), new System.Tuple<Ajuna.NetApi.Model.Meta.Storage.Hasher[], System.Type, System.Type>(null, null, typeof(Ajuna.NetApi.Model.Types.Base.BaseVec<Ajuna.NetApi.Model.Types.Primitive.U8>)));
            _client.StorageKeyDict.Add(new System.Tuple<string, string>("ParachainSystem", "ValidationData"), new System.Tuple<Ajuna.NetApi.Model.Meta.Storage.Hasher[], System.Type, System.Type>(null, null, typeof(Bajun.Network.NET.NetApiExt.Generated.Model.polkadot_primitives.v2.PersistedValidationData)));
            _client.StorageKeyDict.Add(new System.Tuple<string, string>("ParachainSystem", "DidSetValidationCode"), new System.Tuple<Ajuna.NetApi.Model.Meta.Storage.Hasher[], System.Type, System.Type>(null, null, typeof(Ajuna.NetApi.Model.Types.Primitive.Bool)));
            _client.StorageKeyDict.Add(new System.Tuple<string, string>("ParachainSystem", "LastRelayChainBlockNumber"), new System.Tuple<Ajuna.NetApi.Model.Meta.Storage.Hasher[], System.Type, System.Type>(null, null, typeof(Ajuna.NetApi.Model.Types.Primitive.U32)));
            _client.StorageKeyDict.Add(new System.Tuple<string, string>("ParachainSystem", "UpgradeRestrictionSignal"), new System.Tuple<Ajuna.NetApi.Model.Meta.Storage.Hasher[], System.Type, System.Type>(null, null, typeof(Ajuna.NetApi.Model.Types.Base.BaseOpt<Bajun.Network.NET.NetApiExt.Generated.Model.polkadot_primitives.v2.EnumUpgradeRestriction>)));
            _client.StorageKeyDict.Add(new System.Tuple<string, string>("ParachainSystem", "RelayStateProof"), new System.Tuple<Ajuna.NetApi.Model.Meta.Storage.Hasher[], System.Type, System.Type>(null, null, typeof(Bajun.Network.NET.NetApiExt.Generated.Model.sp_trie.storage_proof.StorageProof)));
            _client.StorageKeyDict.Add(new System.Tuple<string, string>("ParachainSystem", "RelevantMessagingState"), new System.Tuple<Ajuna.NetApi.Model.Meta.Storage.Hasher[], System.Type, System.Type>(null, null, typeof(Bajun.Network.NET.NetApiExt.Generated.Model.cumulus_pallet_parachain_system.relay_state_snapshot.MessagingStateSnapshot)));
            _client.StorageKeyDict.Add(new System.Tuple<string, string>("ParachainSystem", "HostConfiguration"), new System.Tuple<Ajuna.NetApi.Model.Meta.Storage.Hasher[], System.Type, System.Type>(null, null, typeof(Bajun.Network.NET.NetApiExt.Generated.Model.polkadot_primitives.v2.AbridgedHostConfiguration)));
            _client.StorageKeyDict.Add(new System.Tuple<string, string>("ParachainSystem", "LastDmqMqcHead"), new System.Tuple<Ajuna.NetApi.Model.Meta.Storage.Hasher[], System.Type, System.Type>(null, null, typeof(Bajun.Network.NET.NetApiExt.Generated.Model.cumulus_primitives_parachain_inherent.MessageQueueChain)));
            _client.StorageKeyDict.Add(new System.Tuple<string, string>("ParachainSystem", "LastHrmpMqcHeads"), new System.Tuple<Ajuna.NetApi.Model.Meta.Storage.Hasher[], System.Type, System.Type>(null, null, typeof(Bajun.Network.NET.NetApiExt.Generated.Types.Base.BTreeMapT1)));
            _client.StorageKeyDict.Add(new System.Tuple<string, string>("ParachainSystem", "ProcessedDownwardMessages"), new System.Tuple<Ajuna.NetApi.Model.Meta.Storage.Hasher[], System.Type, System.Type>(null, null, typeof(Ajuna.NetApi.Model.Types.Primitive.U32)));
            _client.StorageKeyDict.Add(new System.Tuple<string, string>("ParachainSystem", "HrmpWatermark"), new System.Tuple<Ajuna.NetApi.Model.Meta.Storage.Hasher[], System.Type, System.Type>(null, null, typeof(Ajuna.NetApi.Model.Types.Primitive.U32)));
            _client.StorageKeyDict.Add(new System.Tuple<string, string>("ParachainSystem", "HrmpOutboundMessages"), new System.Tuple<Ajuna.NetApi.Model.Meta.Storage.Hasher[], System.Type, System.Type>(null, null, typeof(Ajuna.NetApi.Model.Types.Base.BaseVec<Bajun.Network.NET.NetApiExt.Generated.Model.polkadot_core_primitives.OutboundHrmpMessage>)));
            _client.StorageKeyDict.Add(new System.Tuple<string, string>("ParachainSystem", "UpwardMessages"), new System.Tuple<Ajuna.NetApi.Model.Meta.Storage.Hasher[], System.Type, System.Type>(null, null, typeof(Ajuna.NetApi.Model.Types.Base.BaseVec<Ajuna.NetApi.Model.Types.Base.BaseVec<Ajuna.NetApi.Model.Types.Primitive.U8>>)));
            _client.StorageKeyDict.Add(new System.Tuple<string, string>("ParachainSystem", "PendingUpwardMessages"), new System.Tuple<Ajuna.NetApi.Model.Meta.Storage.Hasher[], System.Type, System.Type>(null, null, typeof(Ajuna.NetApi.Model.Types.Base.BaseVec<Ajuna.NetApi.Model.Types.Base.BaseVec<Ajuna.NetApi.Model.Types.Primitive.U8>>)));
            _client.StorageKeyDict.Add(new System.Tuple<string, string>("ParachainSystem", "AnnouncedHrmpMessagesPerCandidate"), new System.Tuple<Ajuna.NetApi.Model.Meta.Storage.Hasher[], System.Type, System.Type>(null, null, typeof(Ajuna.NetApi.Model.Types.Primitive.U32)));
            _client.StorageKeyDict.Add(new System.Tuple<string, string>("ParachainSystem", "ReservedXcmpWeightOverride"), new System.Tuple<Ajuna.NetApi.Model.Meta.Storage.Hasher[], System.Type, System.Type>(null, null, typeof(Bajun.Network.NET.NetApiExt.Generated.Model.sp_weights.weight_v2.Weight)));
            _client.StorageKeyDict.Add(new System.Tuple<string, string>("ParachainSystem", "ReservedDmpWeightOverride"), new System.Tuple<Ajuna.NetApi.Model.Meta.Storage.Hasher[], System.Type, System.Type>(null, null, typeof(Bajun.Network.NET.NetApiExt.Generated.Model.sp_weights.weight_v2.Weight)));
            _client.StorageKeyDict.Add(new System.Tuple<string, string>("ParachainSystem", "AuthorizedUpgrade"), new System.Tuple<Ajuna.NetApi.Model.Meta.Storage.Hasher[], System.Type, System.Type>(null, null, typeof(Bajun.Network.NET.NetApiExt.Generated.Model.primitive_types.H256)));
            _client.StorageKeyDict.Add(new System.Tuple<string, string>("ParachainSystem", "CustomValidationHeadData"), new System.Tuple<Ajuna.NetApi.Model.Meta.Storage.Hasher[], System.Type, System.Type>(null, null, typeof(Ajuna.NetApi.Model.Types.Base.BaseVec<Ajuna.NetApi.Model.Types.Primitive.U8>)));
        }
        
        /// <summary>
        /// >> PendingValidationCodeParams
        ///  In case of a scheduled upgrade, this storage field contains the validation code to be applied.
        /// 
        ///  As soon as the relay chain gives us the go-ahead signal, we will overwrite the [`:code`][well_known_keys::CODE]
        ///  which will result the next block process with the new validation code. This concludes the upgrade process.
        /// 
        ///  [well_known_keys::CODE]: sp_core::storage::well_known_keys::CODE
        /// </summary>
        public static string PendingValidationCodeParams()
        {
            return RequestGenerator.GetStorage("ParachainSystem", "PendingValidationCode", Ajuna.NetApi.Model.Meta.Storage.Type.Plain);
        }
        
        /// <summary>
        /// >> PendingValidationCodeDefault
        /// Default value as hex string
        /// </summary>
        public static string PendingValidationCodeDefault()
        {
            return "0x00";
        }
        
        /// <summary>
        /// >> PendingValidationCode
        ///  In case of a scheduled upgrade, this storage field contains the validation code to be applied.
        /// 
        ///  As soon as the relay chain gives us the go-ahead signal, we will overwrite the [`:code`][well_known_keys::CODE]
        ///  which will result the next block process with the new validation code. This concludes the upgrade process.
        /// 
        ///  [well_known_keys::CODE]: sp_core::storage::well_known_keys::CODE
        /// </summary>
        public async Task<Ajuna.NetApi.Model.Types.Base.BaseVec<Ajuna.NetApi.Model.Types.Primitive.U8>> PendingValidationCode(CancellationToken token)
        {
            string parameters = ParachainSystemStorage.PendingValidationCodeParams();
            var result = await _client.GetStorageAsync<Ajuna.NetApi.Model.Types.Base.BaseVec<Ajuna.NetApi.Model.Types.Primitive.U8>>(parameters, token);
            return result;
        }
        
        /// <summary>
        /// >> NewValidationCodeParams
        ///  Validation code that is set by the parachain and is to be communicated to collator and
        ///  consequently the relay-chain.
        /// 
        ///  This will be cleared in `on_initialize` of each new block if no other pallet already set
        ///  the value.
        /// </summary>
        public static string NewValidationCodeParams()
        {
            return RequestGenerator.GetStorage("ParachainSystem", "NewValidationCode", Ajuna.NetApi.Model.Meta.Storage.Type.Plain);
        }
        
        /// <summary>
        /// >> NewValidationCodeDefault
        /// Default value as hex string
        /// </summary>
        public static string NewValidationCodeDefault()
        {
            return "0x00";
        }
        
        /// <summary>
        /// >> NewValidationCode
        ///  Validation code that is set by the parachain and is to be communicated to collator and
        ///  consequently the relay-chain.
        /// 
        ///  This will be cleared in `on_initialize` of each new block if no other pallet already set
        ///  the value.
        /// </summary>
        public async Task<Ajuna.NetApi.Model.Types.Base.BaseVec<Ajuna.NetApi.Model.Types.Primitive.U8>> NewValidationCode(CancellationToken token)
        {
            string parameters = ParachainSystemStorage.NewValidationCodeParams();
            var result = await _client.GetStorageAsync<Ajuna.NetApi.Model.Types.Base.BaseVec<Ajuna.NetApi.Model.Types.Primitive.U8>>(parameters, token);
            return result;
        }
        
        /// <summary>
        /// >> ValidationDataParams
        ///  The [`PersistedValidationData`] set for this block.
        ///  This value is expected to be set only once per block and it's never stored
        ///  in the trie.
        /// </summary>
        public static string ValidationDataParams()
        {
            return RequestGenerator.GetStorage("ParachainSystem", "ValidationData", Ajuna.NetApi.Model.Meta.Storage.Type.Plain);
        }
        
        /// <summary>
        /// >> ValidationDataDefault
        /// Default value as hex string
        /// </summary>
        public static string ValidationDataDefault()
        {
            return "0x00";
        }
        
        /// <summary>
        /// >> ValidationData
        ///  The [`PersistedValidationData`] set for this block.
        ///  This value is expected to be set only once per block and it's never stored
        ///  in the trie.
        /// </summary>
        public async Task<Bajun.Network.NET.NetApiExt.Generated.Model.polkadot_primitives.v2.PersistedValidationData> ValidationData(CancellationToken token)
        {
            string parameters = ParachainSystemStorage.ValidationDataParams();
            var result = await _client.GetStorageAsync<Bajun.Network.NET.NetApiExt.Generated.Model.polkadot_primitives.v2.PersistedValidationData>(parameters, token);
            return result;
        }
        
        /// <summary>
        /// >> DidSetValidationCodeParams
        ///  Were the validation data set to notify the relay chain?
        /// </summary>
        public static string DidSetValidationCodeParams()
        {
            return RequestGenerator.GetStorage("ParachainSystem", "DidSetValidationCode", Ajuna.NetApi.Model.Meta.Storage.Type.Plain);
        }
        
        /// <summary>
        /// >> DidSetValidationCodeDefault
        /// Default value as hex string
        /// </summary>
        public static string DidSetValidationCodeDefault()
        {
            return "0x00";
        }
        
        /// <summary>
        /// >> DidSetValidationCode
        ///  Were the validation data set to notify the relay chain?
        /// </summary>
        public async Task<Ajuna.NetApi.Model.Types.Primitive.Bool> DidSetValidationCode(CancellationToken token)
        {
            string parameters = ParachainSystemStorage.DidSetValidationCodeParams();
            var result = await _client.GetStorageAsync<Ajuna.NetApi.Model.Types.Primitive.Bool>(parameters, token);
            return result;
        }
        
        /// <summary>
        /// >> LastRelayChainBlockNumberParams
        ///  The relay chain block number associated with the last parachain block.
        /// </summary>
        public static string LastRelayChainBlockNumberParams()
        {
            return RequestGenerator.GetStorage("ParachainSystem", "LastRelayChainBlockNumber", Ajuna.NetApi.Model.Meta.Storage.Type.Plain);
        }
        
        /// <summary>
        /// >> LastRelayChainBlockNumberDefault
        /// Default value as hex string
        /// </summary>
        public static string LastRelayChainBlockNumberDefault()
        {
            return "0x00000000";
        }
        
        /// <summary>
        /// >> LastRelayChainBlockNumber
        ///  The relay chain block number associated with the last parachain block.
        /// </summary>
        public async Task<Ajuna.NetApi.Model.Types.Primitive.U32> LastRelayChainBlockNumber(CancellationToken token)
        {
            string parameters = ParachainSystemStorage.LastRelayChainBlockNumberParams();
            var result = await _client.GetStorageAsync<Ajuna.NetApi.Model.Types.Primitive.U32>(parameters, token);
            return result;
        }
        
        /// <summary>
        /// >> UpgradeRestrictionSignalParams
        ///  An option which indicates if the relay-chain restricts signalling a validation code upgrade.
        ///  In other words, if this is `Some` and [`NewValidationCode`] is `Some` then the produced
        ///  candidate will be invalid.
        /// 
        ///  This storage item is a mirror of the corresponding value for the current parachain from the
        ///  relay-chain. This value is ephemeral which means it doesn't hit the storage. This value is
        ///  set after the inherent.
        /// </summary>
        public static string UpgradeRestrictionSignalParams()
        {
            return RequestGenerator.GetStorage("ParachainSystem", "UpgradeRestrictionSignal", Ajuna.NetApi.Model.Meta.Storage.Type.Plain);
        }
        
        /// <summary>
        /// >> UpgradeRestrictionSignalDefault
        /// Default value as hex string
        /// </summary>
        public static string UpgradeRestrictionSignalDefault()
        {
            return "0x00";
        }
        
        /// <summary>
        /// >> UpgradeRestrictionSignal
        ///  An option which indicates if the relay-chain restricts signalling a validation code upgrade.
        ///  In other words, if this is `Some` and [`NewValidationCode`] is `Some` then the produced
        ///  candidate will be invalid.
        /// 
        ///  This storage item is a mirror of the corresponding value for the current parachain from the
        ///  relay-chain. This value is ephemeral which means it doesn't hit the storage. This value is
        ///  set after the inherent.
        /// </summary>
        public async Task<Ajuna.NetApi.Model.Types.Base.BaseOpt<Bajun.Network.NET.NetApiExt.Generated.Model.polkadot_primitives.v2.EnumUpgradeRestriction>> UpgradeRestrictionSignal(CancellationToken token)
        {
            string parameters = ParachainSystemStorage.UpgradeRestrictionSignalParams();
            var result = await _client.GetStorageAsync<Ajuna.NetApi.Model.Types.Base.BaseOpt<Bajun.Network.NET.NetApiExt.Generated.Model.polkadot_primitives.v2.EnumUpgradeRestriction>>(parameters, token);
            return result;
        }
        
        /// <summary>
        /// >> RelayStateProofParams
        ///  The state proof for the last relay parent block.
        /// 
        ///  This field is meant to be updated each block with the validation data inherent. Therefore,
        ///  before processing of the inherent, e.g. in `on_initialize` this data may be stale.
        /// 
        ///  This data is also absent from the genesis.
        /// </summary>
        public static string RelayStateProofParams()
        {
            return RequestGenerator.GetStorage("ParachainSystem", "RelayStateProof", Ajuna.NetApi.Model.Meta.Storage.Type.Plain);
        }
        
        /// <summary>
        /// >> RelayStateProofDefault
        /// Default value as hex string
        /// </summary>
        public static string RelayStateProofDefault()
        {
            return "0x00";
        }
        
        /// <summary>
        /// >> RelayStateProof
        ///  The state proof for the last relay parent block.
        /// 
        ///  This field is meant to be updated each block with the validation data inherent. Therefore,
        ///  before processing of the inherent, e.g. in `on_initialize` this data may be stale.
        /// 
        ///  This data is also absent from the genesis.
        /// </summary>
        public async Task<Bajun.Network.NET.NetApiExt.Generated.Model.sp_trie.storage_proof.StorageProof> RelayStateProof(CancellationToken token)
        {
            string parameters = ParachainSystemStorage.RelayStateProofParams();
            var result = await _client.GetStorageAsync<Bajun.Network.NET.NetApiExt.Generated.Model.sp_trie.storage_proof.StorageProof>(parameters, token);
            return result;
        }
        
        /// <summary>
        /// >> RelevantMessagingStateParams
        ///  The snapshot of some state related to messaging relevant to the current parachain as per
        ///  the relay parent.
        /// 
        ///  This field is meant to be updated each block with the validation data inherent. Therefore,
        ///  before processing of the inherent, e.g. in `on_initialize` this data may be stale.
        /// 
        ///  This data is also absent from the genesis.
        /// </summary>
        public static string RelevantMessagingStateParams()
        {
            return RequestGenerator.GetStorage("ParachainSystem", "RelevantMessagingState", Ajuna.NetApi.Model.Meta.Storage.Type.Plain);
        }
        
        /// <summary>
        /// >> RelevantMessagingStateDefault
        /// Default value as hex string
        /// </summary>
        public static string RelevantMessagingStateDefault()
        {
            return "0x00";
        }
        
        /// <summary>
        /// >> RelevantMessagingState
        ///  The snapshot of some state related to messaging relevant to the current parachain as per
        ///  the relay parent.
        /// 
        ///  This field is meant to be updated each block with the validation data inherent. Therefore,
        ///  before processing of the inherent, e.g. in `on_initialize` this data may be stale.
        /// 
        ///  This data is also absent from the genesis.
        /// </summary>
        public async Task<Bajun.Network.NET.NetApiExt.Generated.Model.cumulus_pallet_parachain_system.relay_state_snapshot.MessagingStateSnapshot> RelevantMessagingState(CancellationToken token)
        {
            string parameters = ParachainSystemStorage.RelevantMessagingStateParams();
            var result = await _client.GetStorageAsync<Bajun.Network.NET.NetApiExt.Generated.Model.cumulus_pallet_parachain_system.relay_state_snapshot.MessagingStateSnapshot>(parameters, token);
            return result;
        }
        
        /// <summary>
        /// >> HostConfigurationParams
        ///  The parachain host configuration that was obtained from the relay parent.
        /// 
        ///  This field is meant to be updated each block with the validation data inherent. Therefore,
        ///  before processing of the inherent, e.g. in `on_initialize` this data may be stale.
        /// 
        ///  This data is also absent from the genesis.
        /// </summary>
        public static string HostConfigurationParams()
        {
            return RequestGenerator.GetStorage("ParachainSystem", "HostConfiguration", Ajuna.NetApi.Model.Meta.Storage.Type.Plain);
        }
        
        /// <summary>
        /// >> HostConfigurationDefault
        /// Default value as hex string
        /// </summary>
        public static string HostConfigurationDefault()
        {
            return "0x00";
        }
        
        /// <summary>
        /// >> HostConfiguration
        ///  The parachain host configuration that was obtained from the relay parent.
        /// 
        ///  This field is meant to be updated each block with the validation data inherent. Therefore,
        ///  before processing of the inherent, e.g. in `on_initialize` this data may be stale.
        /// 
        ///  This data is also absent from the genesis.
        /// </summary>
        public async Task<Bajun.Network.NET.NetApiExt.Generated.Model.polkadot_primitives.v2.AbridgedHostConfiguration> HostConfiguration(CancellationToken token)
        {
            string parameters = ParachainSystemStorage.HostConfigurationParams();
            var result = await _client.GetStorageAsync<Bajun.Network.NET.NetApiExt.Generated.Model.polkadot_primitives.v2.AbridgedHostConfiguration>(parameters, token);
            return result;
        }
        
        /// <summary>
        /// >> LastDmqMqcHeadParams
        ///  The last downward message queue chain head we have observed.
        /// 
        ///  This value is loaded before and saved after processing inbound downward messages carried
        ///  by the system inherent.
        /// </summary>
        public static string LastDmqMqcHeadParams()
        {
            return RequestGenerator.GetStorage("ParachainSystem", "LastDmqMqcHead", Ajuna.NetApi.Model.Meta.Storage.Type.Plain);
        }
        
        /// <summary>
        /// >> LastDmqMqcHeadDefault
        /// Default value as hex string
        /// </summary>
        public static string LastDmqMqcHeadDefault()
        {
            return "0x0000000000000000000000000000000000000000000000000000000000000000";
        }
        
        /// <summary>
        /// >> LastDmqMqcHead
        ///  The last downward message queue chain head we have observed.
        /// 
        ///  This value is loaded before and saved after processing inbound downward messages carried
        ///  by the system inherent.
        /// </summary>
        public async Task<Bajun.Network.NET.NetApiExt.Generated.Model.cumulus_primitives_parachain_inherent.MessageQueueChain> LastDmqMqcHead(CancellationToken token)
        {
            string parameters = ParachainSystemStorage.LastDmqMqcHeadParams();
            var result = await _client.GetStorageAsync<Bajun.Network.NET.NetApiExt.Generated.Model.cumulus_primitives_parachain_inherent.MessageQueueChain>(parameters, token);
            return result;
        }
        
        /// <summary>
        /// >> LastHrmpMqcHeadsParams
        ///  The message queue chain heads we have observed per each channel incoming channel.
        /// 
        ///  This value is loaded before and saved after processing inbound downward messages carried
        ///  by the system inherent.
        /// </summary>
        public static string LastHrmpMqcHeadsParams()
        {
            return RequestGenerator.GetStorage("ParachainSystem", "LastHrmpMqcHeads", Ajuna.NetApi.Model.Meta.Storage.Type.Plain);
        }
        
        /// <summary>
        /// >> LastHrmpMqcHeadsDefault
        /// Default value as hex string
        /// </summary>
        public static string LastHrmpMqcHeadsDefault()
        {
            return "0x00";
        }
        
        /// <summary>
        /// >> LastHrmpMqcHeads
        ///  The message queue chain heads we have observed per each channel incoming channel.
        /// 
        ///  This value is loaded before and saved after processing inbound downward messages carried
        ///  by the system inherent.
        /// </summary>
        public async Task<Bajun.Network.NET.NetApiExt.Generated.Types.Base.BTreeMapT1> LastHrmpMqcHeads(CancellationToken token)
        {
            string parameters = ParachainSystemStorage.LastHrmpMqcHeadsParams();
            var result = await _client.GetStorageAsync<Bajun.Network.NET.NetApiExt.Generated.Types.Base.BTreeMapT1>(parameters, token);
            return result;
        }
        
        /// <summary>
        /// >> ProcessedDownwardMessagesParams
        ///  Number of downward messages processed in a block.
        /// 
        ///  This will be cleared in `on_initialize` of each new block.
        /// </summary>
        public static string ProcessedDownwardMessagesParams()
        {
            return RequestGenerator.GetStorage("ParachainSystem", "ProcessedDownwardMessages", Ajuna.NetApi.Model.Meta.Storage.Type.Plain);
        }
        
        /// <summary>
        /// >> ProcessedDownwardMessagesDefault
        /// Default value as hex string
        /// </summary>
        public static string ProcessedDownwardMessagesDefault()
        {
            return "0x00000000";
        }
        
        /// <summary>
        /// >> ProcessedDownwardMessages
        ///  Number of downward messages processed in a block.
        /// 
        ///  This will be cleared in `on_initialize` of each new block.
        /// </summary>
        public async Task<Ajuna.NetApi.Model.Types.Primitive.U32> ProcessedDownwardMessages(CancellationToken token)
        {
            string parameters = ParachainSystemStorage.ProcessedDownwardMessagesParams();
            var result = await _client.GetStorageAsync<Ajuna.NetApi.Model.Types.Primitive.U32>(parameters, token);
            return result;
        }
        
        /// <summary>
        /// >> HrmpWatermarkParams
        ///  HRMP watermark that was set in a block.
        /// 
        ///  This will be cleared in `on_initialize` of each new block.
        /// </summary>
        public static string HrmpWatermarkParams()
        {
            return RequestGenerator.GetStorage("ParachainSystem", "HrmpWatermark", Ajuna.NetApi.Model.Meta.Storage.Type.Plain);
        }
        
        /// <summary>
        /// >> HrmpWatermarkDefault
        /// Default value as hex string
        /// </summary>
        public static string HrmpWatermarkDefault()
        {
            return "0x00000000";
        }
        
        /// <summary>
        /// >> HrmpWatermark
        ///  HRMP watermark that was set in a block.
        /// 
        ///  This will be cleared in `on_initialize` of each new block.
        /// </summary>
        public async Task<Ajuna.NetApi.Model.Types.Primitive.U32> HrmpWatermark(CancellationToken token)
        {
            string parameters = ParachainSystemStorage.HrmpWatermarkParams();
            var result = await _client.GetStorageAsync<Ajuna.NetApi.Model.Types.Primitive.U32>(parameters, token);
            return result;
        }
        
        /// <summary>
        /// >> HrmpOutboundMessagesParams
        ///  HRMP messages that were sent in a block.
        /// 
        ///  This will be cleared in `on_initialize` of each new block.
        /// </summary>
        public static string HrmpOutboundMessagesParams()
        {
            return RequestGenerator.GetStorage("ParachainSystem", "HrmpOutboundMessages", Ajuna.NetApi.Model.Meta.Storage.Type.Plain);
        }
        
        /// <summary>
        /// >> HrmpOutboundMessagesDefault
        /// Default value as hex string
        /// </summary>
        public static string HrmpOutboundMessagesDefault()
        {
            return "0x00";
        }
        
        /// <summary>
        /// >> HrmpOutboundMessages
        ///  HRMP messages that were sent in a block.
        /// 
        ///  This will be cleared in `on_initialize` of each new block.
        /// </summary>
        public async Task<Ajuna.NetApi.Model.Types.Base.BaseVec<Bajun.Network.NET.NetApiExt.Generated.Model.polkadot_core_primitives.OutboundHrmpMessage>> HrmpOutboundMessages(CancellationToken token)
        {
            string parameters = ParachainSystemStorage.HrmpOutboundMessagesParams();
            var result = await _client.GetStorageAsync<Ajuna.NetApi.Model.Types.Base.BaseVec<Bajun.Network.NET.NetApiExt.Generated.Model.polkadot_core_primitives.OutboundHrmpMessage>>(parameters, token);
            return result;
        }
        
        /// <summary>
        /// >> UpwardMessagesParams
        ///  Upward messages that were sent in a block.
        /// 
        ///  This will be cleared in `on_initialize` of each new block.
        /// </summary>
        public static string UpwardMessagesParams()
        {
            return RequestGenerator.GetStorage("ParachainSystem", "UpwardMessages", Ajuna.NetApi.Model.Meta.Storage.Type.Plain);
        }
        
        /// <summary>
        /// >> UpwardMessagesDefault
        /// Default value as hex string
        /// </summary>
        public static string UpwardMessagesDefault()
        {
            return "0x00";
        }
        
        /// <summary>
        /// >> UpwardMessages
        ///  Upward messages that were sent in a block.
        /// 
        ///  This will be cleared in `on_initialize` of each new block.
        /// </summary>
        public async Task<Ajuna.NetApi.Model.Types.Base.BaseVec<Ajuna.NetApi.Model.Types.Base.BaseVec<Ajuna.NetApi.Model.Types.Primitive.U8>>> UpwardMessages(CancellationToken token)
        {
            string parameters = ParachainSystemStorage.UpwardMessagesParams();
            var result = await _client.GetStorageAsync<Ajuna.NetApi.Model.Types.Base.BaseVec<Ajuna.NetApi.Model.Types.Base.BaseVec<Ajuna.NetApi.Model.Types.Primitive.U8>>>(parameters, token);
            return result;
        }
        
        /// <summary>
        /// >> PendingUpwardMessagesParams
        ///  Upward messages that are still pending and not yet send to the relay chain.
        /// </summary>
        public static string PendingUpwardMessagesParams()
        {
            return RequestGenerator.GetStorage("ParachainSystem", "PendingUpwardMessages", Ajuna.NetApi.Model.Meta.Storage.Type.Plain);
        }
        
        /// <summary>
        /// >> PendingUpwardMessagesDefault
        /// Default value as hex string
        /// </summary>
        public static string PendingUpwardMessagesDefault()
        {
            return "0x00";
        }
        
        /// <summary>
        /// >> PendingUpwardMessages
        ///  Upward messages that are still pending and not yet send to the relay chain.
        /// </summary>
        public async Task<Ajuna.NetApi.Model.Types.Base.BaseVec<Ajuna.NetApi.Model.Types.Base.BaseVec<Ajuna.NetApi.Model.Types.Primitive.U8>>> PendingUpwardMessages(CancellationToken token)
        {
            string parameters = ParachainSystemStorage.PendingUpwardMessagesParams();
            var result = await _client.GetStorageAsync<Ajuna.NetApi.Model.Types.Base.BaseVec<Ajuna.NetApi.Model.Types.Base.BaseVec<Ajuna.NetApi.Model.Types.Primitive.U8>>>(parameters, token);
            return result;
        }
        
        /// <summary>
        /// >> AnnouncedHrmpMessagesPerCandidateParams
        ///  The number of HRMP messages we observed in `on_initialize` and thus used that number for
        ///  announcing the weight of `on_initialize` and `on_finalize`.
        /// </summary>
        public static string AnnouncedHrmpMessagesPerCandidateParams()
        {
            return RequestGenerator.GetStorage("ParachainSystem", "AnnouncedHrmpMessagesPerCandidate", Ajuna.NetApi.Model.Meta.Storage.Type.Plain);
        }
        
        /// <summary>
        /// >> AnnouncedHrmpMessagesPerCandidateDefault
        /// Default value as hex string
        /// </summary>
        public static string AnnouncedHrmpMessagesPerCandidateDefault()
        {
            return "0x00000000";
        }
        
        /// <summary>
        /// >> AnnouncedHrmpMessagesPerCandidate
        ///  The number of HRMP messages we observed in `on_initialize` and thus used that number for
        ///  announcing the weight of `on_initialize` and `on_finalize`.
        /// </summary>
        public async Task<Ajuna.NetApi.Model.Types.Primitive.U32> AnnouncedHrmpMessagesPerCandidate(CancellationToken token)
        {
            string parameters = ParachainSystemStorage.AnnouncedHrmpMessagesPerCandidateParams();
            var result = await _client.GetStorageAsync<Ajuna.NetApi.Model.Types.Primitive.U32>(parameters, token);
            return result;
        }
        
        /// <summary>
        /// >> ReservedXcmpWeightOverrideParams
        ///  The weight we reserve at the beginning of the block for processing XCMP messages. This
        ///  overrides the amount set in the Config trait.
        /// </summary>
        public static string ReservedXcmpWeightOverrideParams()
        {
            return RequestGenerator.GetStorage("ParachainSystem", "ReservedXcmpWeightOverride", Ajuna.NetApi.Model.Meta.Storage.Type.Plain);
        }
        
        /// <summary>
        /// >> ReservedXcmpWeightOverrideDefault
        /// Default value as hex string
        /// </summary>
        public static string ReservedXcmpWeightOverrideDefault()
        {
            return "0x00";
        }
        
        /// <summary>
        /// >> ReservedXcmpWeightOverride
        ///  The weight we reserve at the beginning of the block for processing XCMP messages. This
        ///  overrides the amount set in the Config trait.
        /// </summary>
        public async Task<Bajun.Network.NET.NetApiExt.Generated.Model.sp_weights.weight_v2.Weight> ReservedXcmpWeightOverride(CancellationToken token)
        {
            string parameters = ParachainSystemStorage.ReservedXcmpWeightOverrideParams();
            var result = await _client.GetStorageAsync<Bajun.Network.NET.NetApiExt.Generated.Model.sp_weights.weight_v2.Weight>(parameters, token);
            return result;
        }
        
        /// <summary>
        /// >> ReservedDmpWeightOverrideParams
        ///  The weight we reserve at the beginning of the block for processing DMP messages. This
        ///  overrides the amount set in the Config trait.
        /// </summary>
        public static string ReservedDmpWeightOverrideParams()
        {
            return RequestGenerator.GetStorage("ParachainSystem", "ReservedDmpWeightOverride", Ajuna.NetApi.Model.Meta.Storage.Type.Plain);
        }
        
        /// <summary>
        /// >> ReservedDmpWeightOverrideDefault
        /// Default value as hex string
        /// </summary>
        public static string ReservedDmpWeightOverrideDefault()
        {
            return "0x00";
        }
        
        /// <summary>
        /// >> ReservedDmpWeightOverride
        ///  The weight we reserve at the beginning of the block for processing DMP messages. This
        ///  overrides the amount set in the Config trait.
        /// </summary>
        public async Task<Bajun.Network.NET.NetApiExt.Generated.Model.sp_weights.weight_v2.Weight> ReservedDmpWeightOverride(CancellationToken token)
        {
            string parameters = ParachainSystemStorage.ReservedDmpWeightOverrideParams();
            var result = await _client.GetStorageAsync<Bajun.Network.NET.NetApiExt.Generated.Model.sp_weights.weight_v2.Weight>(parameters, token);
            return result;
        }
        
        /// <summary>
        /// >> AuthorizedUpgradeParams
        ///  The next authorized upgrade, if there is one.
        /// </summary>
        public static string AuthorizedUpgradeParams()
        {
            return RequestGenerator.GetStorage("ParachainSystem", "AuthorizedUpgrade", Ajuna.NetApi.Model.Meta.Storage.Type.Plain);
        }
        
        /// <summary>
        /// >> AuthorizedUpgradeDefault
        /// Default value as hex string
        /// </summary>
        public static string AuthorizedUpgradeDefault()
        {
            return "0x00";
        }
        
        /// <summary>
        /// >> AuthorizedUpgrade
        ///  The next authorized upgrade, if there is one.
        /// </summary>
        public async Task<Bajun.Network.NET.NetApiExt.Generated.Model.primitive_types.H256> AuthorizedUpgrade(CancellationToken token)
        {
            string parameters = ParachainSystemStorage.AuthorizedUpgradeParams();
            var result = await _client.GetStorageAsync<Bajun.Network.NET.NetApiExt.Generated.Model.primitive_types.H256>(parameters, token);
            return result;
        }
        
        /// <summary>
        /// >> CustomValidationHeadDataParams
        ///  A custom head data that should be returned as result of `validate_block`.
        /// 
        ///  See [`Pallet::set_custom_validation_head_data`] for more information.
        /// </summary>
        public static string CustomValidationHeadDataParams()
        {
            return RequestGenerator.GetStorage("ParachainSystem", "CustomValidationHeadData", Ajuna.NetApi.Model.Meta.Storage.Type.Plain);
        }
        
        /// <summary>
        /// >> CustomValidationHeadDataDefault
        /// Default value as hex string
        /// </summary>
        public static string CustomValidationHeadDataDefault()
        {
            return "0x00";
        }
        
        /// <summary>
        /// >> CustomValidationHeadData
        ///  A custom head data that should be returned as result of `validate_block`.
        /// 
        ///  See [`Pallet::set_custom_validation_head_data`] for more information.
        /// </summary>
        public async Task<Ajuna.NetApi.Model.Types.Base.BaseVec<Ajuna.NetApi.Model.Types.Primitive.U8>> CustomValidationHeadData(CancellationToken token)
        {
            string parameters = ParachainSystemStorage.CustomValidationHeadDataParams();
            var result = await _client.GetStorageAsync<Ajuna.NetApi.Model.Types.Base.BaseVec<Ajuna.NetApi.Model.Types.Primitive.U8>>(parameters, token);
            return result;
        }
    }
    
    public sealed class ParachainSystemCalls
    {
        
        /// <summary>
        /// >> set_validation_data
        /// Contains one variant per dispatchable that can be called by an extrinsic.
        /// </summary>
        public static Method SetValidationData(Bajun.Network.NET.NetApiExt.Generated.Model.cumulus_primitives_parachain_inherent.ParachainInherentData data)
        {
            System.Collections.Generic.List<byte> byteArray = new List<byte>();
            byteArray.AddRange(data.Encode());
            return new Method(1, "ParachainSystem", 0, "set_validation_data", byteArray.ToArray());
        }
        
        /// <summary>
        /// >> sudo_send_upward_message
        /// Contains one variant per dispatchable that can be called by an extrinsic.
        /// </summary>
        public static Method SudoSendUpwardMessage(Ajuna.NetApi.Model.Types.Base.BaseVec<Ajuna.NetApi.Model.Types.Primitive.U8> message)
        {
            System.Collections.Generic.List<byte> byteArray = new List<byte>();
            byteArray.AddRange(message.Encode());
            return new Method(1, "ParachainSystem", 1, "sudo_send_upward_message", byteArray.ToArray());
        }
        
        /// <summary>
        /// >> authorize_upgrade
        /// Contains one variant per dispatchable that can be called by an extrinsic.
        /// </summary>
        public static Method AuthorizeUpgrade(Bajun.Network.NET.NetApiExt.Generated.Model.primitive_types.H256 code_hash)
        {
            System.Collections.Generic.List<byte> byteArray = new List<byte>();
            byteArray.AddRange(code_hash.Encode());
            return new Method(1, "ParachainSystem", 2, "authorize_upgrade", byteArray.ToArray());
        }
        
        /// <summary>
        /// >> enact_authorized_upgrade
        /// Contains one variant per dispatchable that can be called by an extrinsic.
        /// </summary>
        public static Method EnactAuthorizedUpgrade(Ajuna.NetApi.Model.Types.Base.BaseVec<Ajuna.NetApi.Model.Types.Primitive.U8> code)
        {
            System.Collections.Generic.List<byte> byteArray = new List<byte>();
            byteArray.AddRange(code.Encode());
            return new Method(1, "ParachainSystem", 3, "enact_authorized_upgrade", byteArray.ToArray());
        }
    }
    
    public sealed class ParachainSystemConstants
    {
    }
    
    public enum ParachainSystemErrors
    {
        
        /// <summary>
        /// >> OverlappingUpgrades
        /// Attempt to upgrade validation function while existing upgrade pending
        /// </summary>
        OverlappingUpgrades,
        
        /// <summary>
        /// >> ProhibitedByPolkadot
        /// Polkadot currently prohibits this parachain from upgrading its validation function
        /// </summary>
        ProhibitedByPolkadot,
        
        /// <summary>
        /// >> TooBig
        /// The supplied validation function has compiled into a blob larger than Polkadot is
        /// willing to run
        /// </summary>
        TooBig,
        
        /// <summary>
        /// >> ValidationDataNotAvailable
        /// The inherent which supplies the validation data did not run this block
        /// </summary>
        ValidationDataNotAvailable,
        
        /// <summary>
        /// >> HostConfigurationNotAvailable
        /// The inherent which supplies the host configuration did not run this block
        /// </summary>
        HostConfigurationNotAvailable,
        
        /// <summary>
        /// >> NotScheduled
        /// No validation function upgrade is currently scheduled.
        /// </summary>
        NotScheduled,
        
        /// <summary>
        /// >> NothingAuthorized
        /// No code upgrade has been authorized.
        /// </summary>
        NothingAuthorized,
        
        /// <summary>
        /// >> Unauthorized
        /// The given code upgrade has not been authorized.
        /// </summary>
        Unauthorized,
    }
}
