Class: IndexeaClient::StatsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/indexea_client/api/stats_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ StatsApi

Returns a new instance of StatsApi.



16
17
18
# File 'lib/indexea_client/api/stats_api.rb', line 16

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



14
15
16
# File 'lib/indexea_client/api/stats_api.rb', line 14

def api_client
  @api_client
end

Instance Method Details

#stats_recomms(app, opts = {}) ⇒ Object

获取推荐日志的汇总信息

Parameters:

  • app

    应用标识

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :recomm (Integer)

    统计指定推荐 (default to 0)

  • :start_date (Date)

    统计起始日期

  • :end_date (Date)

    统计结束日期

  • :interval (String)

    统计间隔 - 日、周、月、季度、年 (default to date)

Returns:

  • (Object)


27
28
29
30
# File 'lib/indexea_client/api/stats_api.rb', line 27

def stats_recomms(app, opts = {})
  data, _status_code, _headers = stats_recomms_with_http_info(app, opts)
  data
end

#stats_recomms_with_http_info(app, opts = {}) ⇒ Array<(Object, Integer, Hash)>

获取推荐日志的汇总信息

Parameters:

  • app

    应用标识

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :recomm (Integer)

    统计指定推荐

  • :start_date (Date)

    统计起始日期

  • :end_date (Date)

    统计结束日期

  • :interval (String)

    统计间隔 - 日、周、月、季度、年

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/indexea_client/api/stats_api.rb', line 40

def stats_recomms_with_http_info(app, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: StatsApi.stats_recomms ...'
  end
  # verify the required parameter 'app' is set
  if @api_client.config.client_side_validation && app.nil?
    fail ArgumentError, "Missing the required parameter 'app' when calling StatsApi.stats_recomms"
  end
  if @api_client.config.client_side_validation && opts[:'interval'] && !['date', 'week', 'month', 'quarter', 'year'].include?(opts[:'interval'])
    fail ArgumentError, 'invalid value for "interval", must be one of date, week, month, quarter, year'
  end
  # resource path
  local_var_path = '/stats/{app}/recomms'.sub('{' + 'app' + '}', app.to_s)

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'recomm'] = opts[:'recomm'] if !opts[:'recomm'].nil?
  query_params[:'start_date'] = opts[:'start_date'] if !opts[:'start_date'].nil?
  query_params[:'end_date'] = opts[:'end_date'] if !opts[:'end_date'].nil?
  query_params[:'interval'] = opts[:'interval'] if !opts[:'interval'].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 = opts[:return_type] || 'Object' 

  auth_names = opts[:auth_names] || ['TokenAuth']
  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 => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StatsApi#stats_recomms\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#stats_searchs(app, opts = {}) ⇒ Object

获取搜索日志的汇总信息

Parameters:

  • app

    应用标识

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :index (Integer)

    统计指定索引 (default to 0)

  • :query (Integer)

    统计指定查询 (default to 0)

  • :widget (Integer)

    统计指定组件 (default to 0)

  • :start_date (Date)

    统计起始日期

  • :end_date (Date)

    统计结束日期

  • :interval (String)

    统计间隔 - 日、周、月、季度、年 (default to date)

Returns:

  • (Object)


98
99
100
101
# File 'lib/indexea_client/api/stats_api.rb', line 98

def stats_searchs(app, opts = {})
  data, _status_code, _headers = stats_searchs_with_http_info(app, opts)
  data
end

#stats_searchs_with_http_info(app, opts = {}) ⇒ Array<(Object, Integer, Hash)>

获取搜索日志的汇总信息

Parameters:

  • app

    应用标识

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :index (Integer)

    统计指定索引

  • :query (Integer)

    统计指定查询

  • :widget (Integer)

    统计指定组件

  • :start_date (Date)

    统计起始日期

  • :end_date (Date)

    统计结束日期

  • :interval (String)

    统计间隔 - 日、周、月、季度、年

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# File 'lib/indexea_client/api/stats_api.rb', line 113

def stats_searchs_with_http_info(app, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: StatsApi.stats_searchs ...'
  end
  # verify the required parameter 'app' is set
  if @api_client.config.client_side_validation && app.nil?
    fail ArgumentError, "Missing the required parameter 'app' when calling StatsApi.stats_searchs"
  end
  if @api_client.config.client_side_validation && opts[:'interval'] && !['date', 'week', 'month', 'quarter', 'year'].include?(opts[:'interval'])
    fail ArgumentError, 'invalid value for "interval", must be one of date, week, month, quarter, year'
  end
  # resource path
  local_var_path = '/stats/{app}/searchs'.sub('{' + 'app' + '}', app.to_s)

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'index'] = opts[:'index'] if !opts[:'index'].nil?
  query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil?
  query_params[:'widget'] = opts[:'widget'] if !opts[:'widget'].nil?
  query_params[:'start_date'] = opts[:'start_date'] if !opts[:'start_date'].nil?
  query_params[:'end_date'] = opts[:'end_date'] if !opts[:'end_date'].nil?
  query_params[:'interval'] = opts[:'interval'] if !opts[:'interval'].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 = opts[:return_type] || 'Object' 

  auth_names = opts[:auth_names] || ['TokenAuth']
  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 => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StatsApi#stats_searchs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#stats_top_clicks(app, size, opts = {}) ⇒ Array<Object>

获取点击排行榜

Parameters:

  • app

    应用标识

  • size

    排行榜大小

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :index (Integer)

    统计指定索引 (default to 0)

  • :query (Integer)

    统计指定查询 (default to 0)

  • :recomm (Integer)

    统计指定推荐组件 (default to 0)

  • :widget (Integer)

    统计指定组件 (default to 0)

  • :start_date (Date)

    统计起始日期

  • :end_date (Date)

    统计结束日期

Returns:

  • (Array<Object>)


174
175
176
177
# File 'lib/indexea_client/api/stats_api.rb', line 174

def stats_top_clicks(app, size, opts = {})
  data, _status_code, _headers = stats_top_clicks_with_http_info(app, size, opts)
  data
end

#stats_top_clicks_with_http_info(app, size, opts = {}) ⇒ Array<(Array<Object>, Integer, Hash)>

获取点击排行榜

Parameters:

  • app

    应用标识

  • size

    排行榜大小

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :index (Integer)

    统计指定索引

  • :query (Integer)

    统计指定查询

  • :recomm (Integer)

    统计指定推荐组件

  • :widget (Integer)

    统计指定组件

  • :start_date (Date)

    统计起始日期

  • :end_date (Date)

    统计结束日期

Returns:

  • (Array<(Array<Object>, Integer, Hash)>)

    Array<Object> data, response status code and response headers



190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
# File 'lib/indexea_client/api/stats_api.rb', line 190

def stats_top_clicks_with_http_info(app, size, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: StatsApi.stats_top_clicks ...'
  end
  # verify the required parameter 'app' is set
  if @api_client.config.client_side_validation && app.nil?
    fail ArgumentError, "Missing the required parameter 'app' when calling StatsApi.stats_top_clicks"
  end
  # verify the required parameter 'size' is set
  if @api_client.config.client_side_validation && size.nil?
    fail ArgumentError, "Missing the required parameter 'size' when calling StatsApi.stats_top_clicks"
  end
  # resource path
  local_var_path = '/stats/{app}/top-clicks'.sub('{' + 'app' + '}', app.to_s)

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'size'] = size
  query_params[:'index'] = opts[:'index'] if !opts[:'index'].nil?
  query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil?
  query_params[:'recomm'] = opts[:'recomm'] if !opts[:'recomm'].nil?
  query_params[:'widget'] = opts[:'widget'] if !opts[:'widget'].nil?
  query_params[:'start_date'] = opts[:'start_date'] if !opts[:'start_date'].nil?
  query_params[:'end_date'] = opts[:'end_date'] if !opts[:'end_date'].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 = opts[:return_type] || 'Array<Object>' 

  auth_names = opts[:auth_names] || ['TokenAuth']
  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 => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StatsApi#stats_top_clicks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#stats_widgets(app, opts = {}) ⇒ Object

获取模板与组件的统计信息

Parameters:

  • app

    应用标识

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :widget (Integer)

    统计指定模板或组件 (default to 0)

  • :start_date (Date)

    统计起始日期

  • :end_date (Date)

    统计结束日期

  • :interval (String)

    统计间隔 - 日、周、月、季度、年 (default to date)

Returns:

  • (Object)


250
251
252
253
# File 'lib/indexea_client/api/stats_api.rb', line 250

def stats_widgets(app, opts = {})
  data, _status_code, _headers = stats_widgets_with_http_info(app, opts)
  data
end

#stats_widgets_with_http_info(app, opts = {}) ⇒ Array<(Object, Integer, Hash)>

获取模板与组件的统计信息

Parameters:

  • app

    应用标识

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :widget (Integer)

    统计指定模板或组件

  • :start_date (Date)

    统计起始日期

  • :end_date (Date)

    统计结束日期

  • :interval (String)

    统计间隔 - 日、周、月、季度、年

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
# File 'lib/indexea_client/api/stats_api.rb', line 263

def stats_widgets_with_http_info(app, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: StatsApi.stats_widgets ...'
  end
  # verify the required parameter 'app' is set
  if @api_client.config.client_side_validation && app.nil?
    fail ArgumentError, "Missing the required parameter 'app' when calling StatsApi.stats_widgets"
  end
  if @api_client.config.client_side_validation && opts[:'interval'] && !['date', 'week', 'month', 'quarter', 'year'].include?(opts[:'interval'])
    fail ArgumentError, 'invalid value for "interval", must be one of date, week, month, quarter, year'
  end
  # resource path
  local_var_path = '/stats/{app}/widgets'.sub('{' + 'app' + '}', app.to_s)

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'widget'] = opts[:'widget'] if !opts[:'widget'].nil?
  query_params[:'start_date'] = opts[:'start_date'] if !opts[:'start_date'].nil?
  query_params[:'end_date'] = opts[:'end_date'] if !opts[:'end_date'].nil?
  query_params[:'interval'] = opts[:'interval'] if !opts[:'interval'].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 = opts[:return_type] || 'Object' 

  auth_names = opts[:auth_names] || ['TokenAuth']
  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 => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StatsApi#stats_widgets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end