class KoronaCloudClient::StatisticsApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/korona-cloud-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 [String] 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-cloud-client/api/statistics_api.rb, line 28
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 [String] 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-cloud-client/api/statistics_api.rb, line 98
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 [String] 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, Integer, Hash)>] StatisticMapStringRevenueData data, response status code and response headers

# File lib/korona-cloud-client/api/statistics_api.rb, line 109
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
  allowable_values = ["DAY", "WEEK", "MONTH", "YEAR"]
  if @api_client.config.client_side_validation && opts[:'period'] && !allowable_values.include?(opts[:'period'])
    fail ArgumentError, "invalid value for \"period\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/accounts/{koronaAccountId}/statistics/revenueDataForCustomerGroups'.sub('{' + 'koronaAccountId' + '}', CGI.escape(korona_account_id.to_s))

  # query parameters
  query_params = opts[: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 = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'StatisticMapStringRevenueData' 

  # auth_names
  auth_names = opts[:auth_names] || ['basicAuth']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  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 [String] 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-cloud-client/api/statistics_api.rb, line 168
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 [String] 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, Integer, Hash)>] StatisticMapStringRevenueData data, response status code and response headers

# File lib/korona-cloud-client/api/statistics_api.rb, line 179
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
  allowable_values = ["DAY", "WEEK", "MONTH", "YEAR"]
  if @api_client.config.client_side_validation && opts[:'period'] && !allowable_values.include?(opts[:'period'])
    fail ArgumentError, "invalid value for \"period\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/accounts/{koronaAccountId}/statistics/revenueDataHourly'.sub('{' + 'koronaAccountId' + '}', CGI.escape(korona_account_id.to_s))

  # query parameters
  query_params = opts[: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 = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'StatisticMapStringRevenueData' 

  # auth_names
  auth_names = opts[:auth_names] || ['basicAuth']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  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 [String] 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, Integer, Hash)>] StatisticRevenueData data, response status code and response headers

# File lib/korona-cloud-client/api/statistics_api.rb, line 39
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
  allowable_values = ["DAY", "WEEK", "MONTH", "YEAR"]
  if @api_client.config.client_side_validation && opts[:'period'] && !allowable_values.include?(opts[:'period'])
    fail ArgumentError, "invalid value for \"period\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/accounts/{koronaAccountId}/statistics/revenueData'.sub('{' + 'koronaAccountId' + '}', CGI.escape(korona_account_id.to_s))

  # query parameters
  query_params = opts[: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 = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'StatisticRevenueData' 

  # auth_names
  auth_names = opts[:auth_names] || ['basicAuth']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  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 [String] 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-cloud-client/api/statistics_api.rb, line 239
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 [String] 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, Integer, Hash)>] StatisticListTopSeller data, response status code and response headers

# File lib/korona-cloud-client/api/statistics_api.rb, line 251
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
  allowable_values = ["DAY", "WEEK", "MONTH", "YEAR"]
  if @api_client.config.client_side_validation && opts[:'period'] && !allowable_values.include?(opts[:'period'])
    fail ArgumentError, "invalid value for \"period\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/accounts/{koronaAccountId}/statistics/topSeller'.sub('{' + 'koronaAccountId' + '}', CGI.escape(korona_account_id.to_s))

  # query parameters
  query_params = opts[: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 = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'StatisticListTopSeller' 

  # auth_names
  auth_names = opts[:auth_names] || ['basicAuth']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  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