def authenticate email, credentials={}
      if password = credentials[:with_password]
        refresh_token email: email, password: password
      elsif secret = credentials[:with_api_secret]
        api_key = OpenSSL::Digest::SHA256.new("#{email}:#{secret}:#{token.token}").to_s
        refresh_token email: email, api_key: api_key
      else
        raise ArgumentError, "Must provide either `with_password` or `with_api_secret` arguments."
      end
    end
def authenticate email, credentials={}
      if password = credentials[:with_password]
        refresh_token email: email, password: password
      elsif secret = credentials[:with_api_secret]
        api_key = OpenSSL::Digest::SHA256.new("#{email}:#{secret}:#{token.token}").to_s
        refresh_token email: email, api_key: api_key
      else
        raise ArgumentError, "Must provide either `with_password` or `with_api_secret` arguments."
      end
    end
Create an new Client object.

 @param connection:
 pass in a subclass of connection which implements the `request` method
 with whichever HTTP client library you prefer.  Default is Net::HTTP.
 Authenticate to the API using a email and password.

 @param email
 @param credentials
   A hash with either the `with_password` or `with_api_secret` key.