//------------------------------------------------------------------------------
// <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>
//------------------------------------------------------------------------------

namespace Bajun.Network.NET.RestClient.Generated.Clients
{
   using System;
   using System.Threading.Tasks;
   using System.Net.Http;
   using Bajun.Network.NET.NetApiExt.Generated.Model.sp_core.bounded.bounded_vec;
   using Ajuna.NetApi.Model.Types.Primitive;
   using Bajun.Network.NET.RestClient.Generated.Interfaces;
   
   public sealed class CollatorSelectionControllerClient : BaseClient, ICollatorSelectionControllerClient
   {
      private HttpClient _httpClient;
      private BaseSubscriptionClient _subscriptionClient;
      public CollatorSelectionControllerClient(HttpClient httpClient, BaseSubscriptionClient subscriptionClient)
      {
         _httpClient = httpClient;
         _subscriptionClient = subscriptionClient;
      }
      public async Task<BoundedVecT24> GetInvulnerables()
      {
         return await SendRequestAsync<BoundedVecT24>(_httpClient, "collatorselection/invulnerables");
      }
      public async Task<bool> SubscribeInvulnerables()
      {
         return await _subscriptionClient.SubscribeAsync("CollatorSelection.Invulnerables");
      }
      public async Task<BoundedVecT25> GetCandidates()
      {
         return await SendRequestAsync<BoundedVecT25>(_httpClient, "collatorselection/candidates");
      }
      public async Task<bool> SubscribeCandidates()
      {
         return await _subscriptionClient.SubscribeAsync("CollatorSelection.Candidates");
      }
      public async Task<U32> GetLastAuthoredBlock(Bajun.Network.NET.NetApiExt.Generated.Model.sp_core.crypto.AccountId32 key)
      {
         return await SendRequestAsync<U32>(_httpClient, "collatorselection/lastauthoredblock", Bajun.Network.NET.NetApiExt.Generated.Storage.CollatorSelectionStorage.LastAuthoredBlockParams(key));
      }
      public async Task<bool> SubscribeLastAuthoredBlock(Bajun.Network.NET.NetApiExt.Generated.Model.sp_core.crypto.AccountId32 key)
      {
         return await _subscriptionClient.SubscribeAsync("CollatorSelection.LastAuthoredBlock", Bajun.Network.NET.NetApiExt.Generated.Storage.CollatorSelectionStorage.LastAuthoredBlockParams(key));
      }
      public async Task<U32> GetDesiredCandidates()
      {
         return await SendRequestAsync<U32>(_httpClient, "collatorselection/desiredcandidates");
      }
      public async Task<bool> SubscribeDesiredCandidates()
      {
         return await _subscriptionClient.SubscribeAsync("CollatorSelection.DesiredCandidates");
      }
      public async Task<U128> GetCandidacyBond()
      {
         return await SendRequestAsync<U128>(_httpClient, "collatorselection/candidacybond");
      }
      public async Task<bool> SubscribeCandidacyBond()
      {
         return await _subscriptionClient.SubscribeAsync("CollatorSelection.CandidacyBond");
      }
   }
}
