=begin
#Brainrex API Explorer

#Welcome to the Brainrex API explorer, we make analytics tools for crypto and blockchain. Our currently propiertary models offer sentiment analysis, market making, blockchain monitoring and face-id verification. This AI models can be consumed from this API. We also offer integrations to open data and propietary data providers, as well as free test data we collect. There is a collection of data transformation tools. Join our Telegram group to get the latest news and ask questions [https://t.me/brainrex, #brainrex](https://t.me/brainrex). More about Brainrex at [https://brainrex.com](http://brainrex.com). Full Documentation can be found at [https://brainrexapi.github.io/docs](https://brainrexapi.github.io/docs)

OpenAPI spec version: 0.1.1
Contact: support@brainrex.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
Swagger Codegen version: 2.4.8

=end

require 'uri'

module SwaggerClient
  class SentimentAnalysisApi
    attr_accessor :api_client

    def initialize(api_client = ApiClient.default)
      @api_client = api_client
    end
    # Sentiment analysis score using a model trained for buy signals.
    # Gives a 0 to 1 score, depending on buy/sell sentiment
    # @param text String of text to be analyzed. I can be in any language.
    # @param [Hash] opts the optional parameters
    # @return [String]
    def sentiment_get_price_sentiment(text, opts = {})
      data, _status_code, _headers = sentiment_get_price_sentiment_with_http_info(text, opts)
      data
    end

    # Sentiment analysis score using a model trained for buy signals.
    # Gives a 0 to 1 score, depending on buy/sell sentiment
    # @param text String of text to be analyzed. I can be in any language.
    # @param [Hash] opts the optional parameters
    # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
    def sentiment_get_price_sentiment_with_http_info(text, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: SentimentAnalysisApi.sentiment_get_price_sentiment ...'
      end
      # verify the required parameter 'text' is set
      if @api_client.config.client_side_validation && text.nil?
        fail ArgumentError, "Missing the required parameter 'text' when calling SentimentAnalysisApi.sentiment_get_price_sentiment"
      end
      # resource path
      local_var_path = '/get_buy_sentiment'

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(text)
      auth_names = []
      data, status_code, headers = @api_client.call_api(:POST, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'String')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: SentimentAnalysisApi#sentiment_get_price_sentiment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Sentiment analysis for any given blob of text
    # Gives a -1 to 1 score, depending on bearish/bullish sentiment
    # @param text String of text to be analyzed. I can be in any language.
    # @param [Hash] opts the optional parameters
    # @return [String]
    def sentiment_get_sentiment(text, opts = {})
      data, _status_code, _headers = sentiment_get_sentiment_with_http_info(text, opts)
      data
    end

    # Sentiment analysis for any given blob of text
    # Gives a -1 to 1 score, depending on bearish/bullish sentiment
    # @param text String of text to be analyzed. I can be in any language.
    # @param [Hash] opts the optional parameters
    # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
    def sentiment_get_sentiment_with_http_info(text, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: SentimentAnalysisApi.sentiment_get_sentiment ...'
      end
      # verify the required parameter 'text' is set
      if @api_client.config.client_side_validation && text.nil?
        fail ArgumentError, "Missing the required parameter 'text' when calling SentimentAnalysisApi.sentiment_get_sentiment"
      end
      # resource path
      local_var_path = '/get_sentiment'

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(text)
      auth_names = []
      data, status_code, headers = @api_client.call_api(:POST, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'String')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: SentimentAnalysisApi#sentiment_get_sentiment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
  end
end
