class KoronaClient::StatisticsApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/korona_client/api/statistics_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

get_revenue(korona_account_id, opts = {}) click to toggle source

returns information about the revenue in the given period

@param korona_account_id account id of the KORONA.cloud account @param [Hash] opts the optional parameters @option opts [String] :organizational_unit number of the organizational unit @option opts [String] :period time period for comparison @return [StatisticRevenueData]

# File lib/korona_client/api/statistics_api.rb, line 29
def get_revenue(korona_account_id, opts = {})
  data, _status_code, _headers = get_revenue_with_http_info(korona_account_id, opts)
  data
end
get_revenue_for_customer_groups(korona_account_id, opts = {}) click to toggle source

returns the turnover per customer group during the given period

@param korona_account_id account id of the KORONA.cloud account @param [Hash] opts the optional parameters @option opts [String] :organizational_unit number of the organizational unit @option opts [String] :period time period for comparison @return [StatisticMapStringRevenueData]

# File lib/korona_client/api/statistics_api.rb, line 92
def get_revenue_for_customer_groups(korona_account_id, opts = {})
  data, _status_code, _headers = get_revenue_for_customer_groups_with_http_info(korona_account_id, opts)
  data
end
get_revenue_for_customer_groups_with_http_info(korona_account_id, opts = {}) click to toggle source

returns the turnover per customer group during the given period

@param korona_account_id account id of the KORONA.cloud account @param [Hash] opts the optional parameters @option opts [String] :organizational_unit number of the organizational unit @option opts [String] :period time period for comparison @return [Array<(StatisticMapStringRevenueData, Fixnum, Hash)>] StatisticMapStringRevenueData data, response status code and response headers

# File lib/korona_client/api/statistics_api.rb, line 104
def get_revenue_for_customer_groups_with_http_info(korona_account_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: StatisticsApi.get_revenue_for_customer_groups ...'
  end
  # verify the required parameter 'korona_account_id' is set
  if @api_client.config.client_side_validation && korona_account_id.nil?
    fail ArgumentError, "Missing the required parameter 'korona_account_id' when calling StatisticsApi.get_revenue_for_customer_groups"
  end
  if @api_client.config.client_side_validation && opts[:'period'] && !['DAY', 'WEEK', 'MONTH', 'YEAR'].include?(opts[:'period'])
    fail ArgumentError, 'invalid value for "period", must be one of DAY, WEEK, MONTH, YEAR'
  end
  # resource path
  local_var_path = '/accounts/{koronaAccountId}/statistics/revenueDataForCustomerGroups'.sub('{' + 'koronaAccountId' + '}', korona_account_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'organizationalUnit'] = opts[:'organizational_unit'] if !opts[:'organizational_unit'].nil?
  query_params[:'period'] = opts[:'period'] if !opts[:'period'].nil?

  # 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 = nil
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'StatisticMapStringRevenueData')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StatisticsApi#get_revenue_for_customer_groups\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_revenue_hourly(korona_account_id, opts = {}) click to toggle source

returns the turnover per hour during the given period

@param korona_account_id account id of the KORONA.cloud account @param [Hash] opts the optional parameters @option opts [String] :organizational_unit number of the organizational unit @option opts [String] :period time period for comparison @return [StatisticMapStringRevenueData]

# File lib/korona_client/api/statistics_api.rb, line 155
def get_revenue_hourly(korona_account_id, opts = {})
  data, _status_code, _headers = get_revenue_hourly_with_http_info(korona_account_id, opts)
  data
end
get_revenue_hourly_with_http_info(korona_account_id, opts = {}) click to toggle source

returns the turnover per hour during the given period

@param korona_account_id account id of the KORONA.cloud account @param [Hash] opts the optional parameters @option opts [String] :organizational_unit number of the organizational unit @option opts [String] :period time period for comparison @return [Array<(StatisticMapStringRevenueData, Fixnum, Hash)>] StatisticMapStringRevenueData data, response status code and response headers

# File lib/korona_client/api/statistics_api.rb, line 167
def get_revenue_hourly_with_http_info(korona_account_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: StatisticsApi.get_revenue_hourly ...'
  end
  # verify the required parameter 'korona_account_id' is set
  if @api_client.config.client_side_validation && korona_account_id.nil?
    fail ArgumentError, "Missing the required parameter 'korona_account_id' when calling StatisticsApi.get_revenue_hourly"
  end
  if @api_client.config.client_side_validation && opts[:'period'] && !['DAY', 'WEEK', 'MONTH', 'YEAR'].include?(opts[:'period'])
    fail ArgumentError, 'invalid value for "period", must be one of DAY, WEEK, MONTH, YEAR'
  end
  # resource path
  local_var_path = '/accounts/{koronaAccountId}/statistics/revenueDataHourly'.sub('{' + 'koronaAccountId' + '}', korona_account_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'organizationalUnit'] = opts[:'organizational_unit'] if !opts[:'organizational_unit'].nil?
  query_params[:'period'] = opts[:'period'] if !opts[:'period'].nil?

  # 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 = nil
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'StatisticMapStringRevenueData')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StatisticsApi#get_revenue_hourly\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_revenue_with_http_info(korona_account_id, opts = {}) click to toggle source

returns information about the revenue in the given period

@param korona_account_id account id of the KORONA.cloud account @param [Hash] opts the optional parameters @option opts [String] :organizational_unit number of the organizational unit @option opts [String] :period time period for comparison @return [Array<(StatisticRevenueData, Fixnum, Hash)>] StatisticRevenueData data, response status code and response headers

# File lib/korona_client/api/statistics_api.rb, line 41
def get_revenue_with_http_info(korona_account_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: StatisticsApi.get_revenue ...'
  end
  # verify the required parameter 'korona_account_id' is set
  if @api_client.config.client_side_validation && korona_account_id.nil?
    fail ArgumentError, "Missing the required parameter 'korona_account_id' when calling StatisticsApi.get_revenue"
  end
  if @api_client.config.client_side_validation && opts[:'period'] && !['DAY', 'WEEK', 'MONTH', 'YEAR'].include?(opts[:'period'])
    fail ArgumentError, 'invalid value for "period", must be one of DAY, WEEK, MONTH, YEAR'
  end
  # resource path
  local_var_path = '/accounts/{koronaAccountId}/statistics/revenueData'.sub('{' + 'koronaAccountId' + '}', korona_account_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'organizationalUnit'] = opts[:'organizational_unit'] if !opts[:'organizational_unit'].nil?
  query_params[:'period'] = opts[:'period'] if !opts[:'period'].nil?

  # 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 = nil
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'StatisticRevenueData')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StatisticsApi#get_revenue\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_top_seller(korona_account_id, opts = {}) click to toggle source

returns the top-seller

@param korona_account_id account id of the KORONA.cloud account @param [Hash] opts the optional parameters @option opts [String] :organizational_unit number of the organizational unit @option opts [String] :period time period for comparison @option opts [Integer] :limit maximum number of products to show @return [StatisticListTopSeller]

# File lib/korona_client/api/statistics_api.rb, line 219
def get_top_seller(korona_account_id, opts = {})
  data, _status_code, _headers = get_top_seller_with_http_info(korona_account_id, opts)
  data
end
get_top_seller_with_http_info(korona_account_id, opts = {}) click to toggle source

returns the top-seller

@param korona_account_id account id of the KORONA.cloud account @param [Hash] opts the optional parameters @option opts [String] :organizational_unit number of the organizational unit @option opts [String] :period time period for comparison @option opts [Integer] :limit maximum number of products to show @return [Array<(StatisticListTopSeller, Fixnum, Hash)>] StatisticListTopSeller data, response status code and response headers

# File lib/korona_client/api/statistics_api.rb, line 232
def get_top_seller_with_http_info(korona_account_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: StatisticsApi.get_top_seller ...'
  end
  # verify the required parameter 'korona_account_id' is set
  if @api_client.config.client_side_validation && korona_account_id.nil?
    fail ArgumentError, "Missing the required parameter 'korona_account_id' when calling StatisticsApi.get_top_seller"
  end
  if @api_client.config.client_side_validation && opts[:'period'] && !['DAY', 'WEEK', 'MONTH', 'YEAR'].include?(opts[:'period'])
    fail ArgumentError, 'invalid value for "period", must be one of DAY, WEEK, MONTH, YEAR'
  end
  # resource path
  local_var_path = '/accounts/{koronaAccountId}/statistics/topSeller'.sub('{' + 'koronaAccountId' + '}', korona_account_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'organizationalUnit'] = opts[:'organizational_unit'] if !opts[:'organizational_unit'].nil?
  query_params[:'period'] = opts[:'period'] if !opts[:'period'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?

  # 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 = nil
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'StatisticListTopSeller')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StatisticsApi#get_top_seller\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end