//------------------------------------------------------------------------------
// <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 Ajuna.NetApi.Model.Types.Primitive;
   using Bajun.Network.NET.NetApiExt.Generated.Model.pallet_treasury;
   using Bajun.Network.NET.NetApiExt.Generated.Model.sp_core.bounded.bounded_vec;
   using Bajun.Network.NET.RestClient.Generated.Interfaces;
   
   public sealed class TreasuryControllerClient : BaseClient, ITreasuryControllerClient
   {
      private HttpClient _httpClient;
      private BaseSubscriptionClient _subscriptionClient;
      public TreasuryControllerClient(HttpClient httpClient, BaseSubscriptionClient subscriptionClient)
      {
         _httpClient = httpClient;
         _subscriptionClient = subscriptionClient;
      }
      public async Task<U32> GetProposalCount()
      {
         return await SendRequestAsync<U32>(_httpClient, "treasury/proposalcount");
      }
      public async Task<bool> SubscribeProposalCount()
      {
         return await _subscriptionClient.SubscribeAsync("Treasury.ProposalCount");
      }
      public async Task<Proposal> GetProposals(U32 key)
      {
         return await SendRequestAsync<Proposal>(_httpClient, "treasury/proposals", Bajun.Network.NET.NetApiExt.Generated.Storage.TreasuryStorage.ProposalsParams(key));
      }
      public async Task<bool> SubscribeProposals(U32 key)
      {
         return await _subscriptionClient.SubscribeAsync("Treasury.Proposals", Bajun.Network.NET.NetApiExt.Generated.Storage.TreasuryStorage.ProposalsParams(key));
      }
      public async Task<U128> GetDeactivated()
      {
         return await SendRequestAsync<U128>(_httpClient, "treasury/deactivated");
      }
      public async Task<bool> SubscribeDeactivated()
      {
         return await _subscriptionClient.SubscribeAsync("Treasury.Deactivated");
      }
      public async Task<BoundedVecT27> GetApprovals()
      {
         return await SendRequestAsync<BoundedVecT27>(_httpClient, "treasury/approvals");
      }
      public async Task<bool> SubscribeApprovals()
      {
         return await _subscriptionClient.SubscribeAsync("Treasury.Approvals");
      }
   }
}
