class KoronaEntryClient::StatisticsApi
Attributes
Public Class Methods
# File lib/korona-entry-client/api/statistics_api.rb, line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Prepares entries statistically and returns them as a list. @param client [String] Identification of executing client. @param time_from [DateTime] Log time from. @param time_to [DateTime] Log time to. @param ticket_type [String] @param grouped_entries_type [String] @param [Hash] opts the optional parameters @option opts [Array<String>] :organizational_unit_numbers @option opts [Array<String>] :tags @return [Array<StatisticGroupedEntry>]
# File lib/korona-entry-client/api/statistics_api.rb, line 32 def load_grouped_entries(client, time_from, time_to, ticket_type, grouped_entries_type, opts = {}) data, _status_code, _headers = load_grouped_entries_with_http_info(client, time_from, time_to, ticket_type, grouped_entries_type, opts) data end
Prepares entries statistically and returns them as a list. @param client [String] Identification of executing client. @param time_from [DateTime] Log time from. @param time_to [DateTime] Log time to. @param ticket_type [String] @param grouped_entries_type [String] @param [Hash] opts the optional parameters @option opts [Array<String>] :organizational_unit_numbers @option opts [Array<String>] :tags @return [Array<(Array<StatisticGroupedEntry>, Integer, Hash)>] Array<StatisticGroupedEntry> data, response status code and response headers
# File lib/korona-entry-client/api/statistics_api.rb, line 47 def load_grouped_entries_with_http_info(client, time_from, time_to, ticket_type, grouped_entries_type, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: StatisticsApi.load_grouped_entries ...' end # verify the required parameter 'client' is set if @api_client.config.client_side_validation && client.nil? fail ArgumentError, "Missing the required parameter 'client' when calling StatisticsApi.load_grouped_entries" end # verify the required parameter 'time_from' is set if @api_client.config.client_side_validation && time_from.nil? fail ArgumentError, "Missing the required parameter 'time_from' when calling StatisticsApi.load_grouped_entries" end # verify the required parameter 'time_to' is set if @api_client.config.client_side_validation && time_to.nil? fail ArgumentError, "Missing the required parameter 'time_to' when calling StatisticsApi.load_grouped_entries" end # verify the required parameter 'ticket_type' is set if @api_client.config.client_side_validation && ticket_type.nil? fail ArgumentError, "Missing the required parameter 'ticket_type' when calling StatisticsApi.load_grouped_entries" end # verify enum value allowable_values = ["ALL_TICKETS", "INTERNAL_TICKETS", "EXTERNAL_TICKETS"] if @api_client.config.client_side_validation && !allowable_values.include?(ticket_type) fail ArgumentError, "invalid value for \"ticket_type\", must be one of #{allowable_values}" end # verify the required parameter 'grouped_entries_type' is set if @api_client.config.client_side_validation && grouped_entries_type.nil? fail ArgumentError, "Missing the required parameter 'grouped_entries_type' when calling StatisticsApi.load_grouped_entries" end # verify enum value allowable_values = ["DAY", "DAY_UNIQUE_TICKETS", "HOUR", "ENTRY_GATES"] if @api_client.config.client_side_validation && !allowable_values.include?(grouped_entries_type) fail ArgumentError, "invalid value for \"grouped_entries_type\", must be one of #{allowable_values}" end # resource path local_var_path = '/{client}/statistics/groupedEntries'.sub('{' + 'client' + '}', CGI.escape(client.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'timeFrom'] = time_from query_params[:'timeTo'] = time_to query_params[:'ticketType'] = ticket_type query_params[:'groupedEntriesType'] = grouped_entries_type query_params[:'organizationalUnitNumbers'] = @api_client.build_collection_param(opts[:'organizational_unit_numbers'], :multi) if !opts[:'organizational_unit_numbers'].nil? query_params[:'tags'] = @api_client.build_collection_param(opts[:'tags'], :multi) if !opts[:'tags'].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] || 'Array<StatisticGroupedEntry>' # auth_names auth_names = opts[:auth_names] || [] 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#load_grouped_entries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end