=begin
#Mojang API

#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

OpenAPI spec version: 2020-06-05

Generated by: https://openapi-generator.tech
OpenAPI Generator version: 3.3.4

=end

require 'uri'

module OpenapiClient
  class MiscellaneousApi
    attr_accessor :api_client

    def initialize(api_client = ApiClient.default)
      @api_client = api_client
    end
    # Get statistics on the sales of Minecraft.
    # @param order_statistics_request The payload is a json list of options under the metricKeys key. You will receive a single object corresponding to the sum of sales of the requested type(s). You must request at least one type of sale. Below is the default list used by https://minecraft.net/en/stats/
    # @param [Hash] opts the optional parameters
    # @return [OrderStatisticsResponse]
    def get_orders_statistics(order_statistics_request, opts = {})
      data, _status_code, _headers = get_orders_statistics_with_http_info(order_statistics_request, opts)
      data
    end

    # Get statistics on the sales of Minecraft.
    # @param order_statistics_request The payload is a json list of options under the metricKeys key. You will receive a single object corresponding to the sum of sales of the requested type(s). You must request at least one type of sale. Below is the default list used by https://minecraft.net/en/stats/
    # @param [Hash] opts the optional parameters
    # @return [Array<(OrderStatisticsResponse, Fixnum, Hash)>] OrderStatisticsResponse data, response status code and response headers
    def get_orders_statistics_with_http_info(order_statistics_request, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: MiscellaneousApi.get_orders_statistics ...'
      end
      # verify the required parameter 'order_statistics_request' is set
      if @api_client.config.client_side_validation && order_statistics_request.nil?
        fail ArgumentError, "Missing the required parameter 'order_statistics_request' when calling MiscellaneousApi.get_orders_statistics"
      end
      # resource path
      local_var_path = '/orders/statistics'

      # 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(order_statistics_request)
      auth_names = ['MojangStatisticsToken']
      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 => 'OrderStatisticsResponse')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: MiscellaneousApi#get_orders_statistics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

  end
end
