require 'terminal/utils'

module Terminal
  module Modules
    module UsageAndCredits
      include Terminal::Utils

      # Get the current balance of your account
      #
      # @see https://www.terminal.com/api/docs#balance
      # @authentication Requires user_token and access_token
      # @return [Hash] of balance as a key
      def balance
        options = {}
        options[:auth] = true
        perform(:post, 'balance', options)
      end

      #  Get a history of charges to your account balance
      #
      # @see https://www.terminal.com/api/docs#burn-history
      # @authentication Requires user_token and access_token
      # @return [Hash] of history of account balance
      def burn_history
        options = {}
        options[:auth] = true
        perform(:post, 'burn_history', options)
      end

      #  Get a summary of current active charges to your account balance
      #
      # @see https://www.terminal.com/api/docs#burn-state
      # @authentication Requires user_token and access_token
      # @return [Hash] of current account balance
      def burn_state
        options = {}
        options[:auth] = true
        perform(:post, 'burn_state', options)
      end

      # Get a summary of the chargers to your account, based on each Terminal
      # instance to you have provisions
      #
      # @see https://www.terminal.com/api/docs#burn-estimates
      # @authentication Requires user_token and access_token
      # @return [Hash] of burn estimates
      def burn_estimates
        options = {}
        options[:auth] = true
        perform(:post, 'burn_estimates', options)
      end

    end
  end
end