Class: SwaggerClient::UsageApi

Inherits:
Object
  • Object
show all
Defined in:
lib/swagger_client/api/usage_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ UsageApi

Returns a new instance of UsageApi.



19
20
21
# File 'lib/swagger_client/api/usage_api.rb', line 19

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/swagger_client/api/usage_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#add_and_apply_bulk_payments_csv(opts = {}) ⇒ BulkPaymentUploadResult

Add and apply bulk payments to invoices CSV Bulk upload payments to invoices in CSV file

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :file (File)

Returns:



27
28
29
30
# File 'lib/swagger_client/api/usage_api.rb', line 27

def add_and_apply_bulk_payments_csv(opts = {})
  data, _status_code, _headers = add_and_apply_bulk_payments_csv_with_http_info(opts)
  data
end

#add_and_apply_bulk_payments_csv_with_http_info(opts = {}) ⇒ Array<(BulkPaymentUploadResult, Fixnum, Hash)>

Add and apply bulk payments to invoices CSV Bulk upload payments to invoices in CSV file

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :file (File)

Returns:

  • (Array<(BulkPaymentUploadResult, Fixnum, Hash)>)

    BulkPaymentUploadResult data, response status code and response headers



37
38
39
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
# File 'lib/swagger_client/api/usage_api.rb', line 37

def add_and_apply_bulk_payments_csv_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsageApi.add_and_apply_bulk_payments_csv ...'
  end
  # resource path
  local_var_path = '/settlements/addAndApplyPaymentsInBulk/csv'

  # 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(['multipart/form-data'])

  # form parameters
  form_params = {}
  form_params['file'] = opts[:'file'] if !opts[:'file'].nil?

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  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 => 'BulkPaymentUploadResult')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsageApi#add_and_apply_bulk_payments_csv\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#add_usage(opts = {}) ⇒ UsageBatchInsertResult

Add usage record Load usage records into the system

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:



78
79
80
81
# File 'lib/swagger_client/api/usage_api.rb', line 78

def add_usage(opts = {})
  data, _status_code, _headers = add_usage_with_http_info(opts)
  data
end

#add_usage_with_http_info(opts = {}) ⇒ Array<(UsageBatchInsertResult, Fixnum, Hash)>

Add usage record Load usage records into the system

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(UsageBatchInsertResult, Fixnum, Hash)>)

    UsageBatchInsertResult data, response status code and response headers



88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# File 'lib/swagger_client/api/usage_api.rb', line 88

def add_usage_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsageApi.add_usage ...'
  end
  # resource path
  local_var_path = '/v2/usage'

  # 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(opts[:'body'])
  auth_names = ['ApiKeyAuth']
  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 => 'UsageBatchInsertResult')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsageApi#add_usage\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_usage_aggregates_for_subscription(subscription_id, from, to, opts = {}) ⇒ Array<UsageAggregateOutput>

Get aggregated usage Retrieve the current aggregated usage data for a subscription between 2 instants

Parameters:

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

    the optional parameters

Returns:



130
131
132
133
# File 'lib/swagger_client/api/usage_api.rb', line 130

def get_usage_aggregates_for_subscription(subscription_id, from, to, opts = {})
  data, _status_code, _headers = get_usage_aggregates_for_subscription_with_http_info(subscription_id, from, to, opts)
  data
end

#get_usage_aggregates_for_subscription_with_http_info(subscription_id, from, to, opts = {}) ⇒ Array<(Array<UsageAggregateOutput>, Fixnum, Hash)>

Get aggregated usage Retrieve the current aggregated usage data for a subscription between 2 instants

Parameters:

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

    the optional parameters

Returns:

  • (Array<(Array<UsageAggregateOutput>, Fixnum, Hash)>)

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



142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
# File 'lib/swagger_client/api/usage_api.rb', line 142

def get_usage_aggregates_for_subscription_with_http_info(subscription_id, from, to, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsageApi.get_usage_aggregates_for_subscription ...'
  end
  # verify the required parameter 'subscription_id' is set
  if @api_client.config.client_side_validation && subscription_id.nil?
    fail ArgumentError, "Missing the required parameter 'subscription_id' when calling UsageApi.get_usage_aggregates_for_subscription"
  end
  # verify the required parameter 'from' is set
  if @api_client.config.client_side_validation && from.nil?
    fail ArgumentError, "Missing the required parameter 'from' when calling UsageApi.get_usage_aggregates_for_subscription"
  end
  # verify the required parameter 'to' is set
  if @api_client.config.client_side_validation && to.nil?
    fail ArgumentError, "Missing the required parameter 'to' when calling UsageApi.get_usage_aggregates_for_subscription"
  end
  # resource path
  local_var_path = '/v2/usage/{subscriptionId}'.sub('{' + 'subscriptionId' + '}', subscription_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'from'] = from
  query_params[:'to'] = to

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  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 => 'Array<UsageAggregateOutput>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsageApi#get_usage_aggregates_for_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_usage_arrival_time_checkpoint(opts = {}) ⇒ nil

Get usage arrival checkpoint Retrieve the latest usage record upload to the system as epoch seconds

Parameters:

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

    the optional parameters

Returns:

  • (nil)


193
194
195
196
# File 'lib/swagger_client/api/usage_api.rb', line 193

def get_usage_arrival_time_checkpoint(opts = {})
  get_usage_arrival_time_checkpoint_with_http_info(opts)
  nil
end

#get_usage_arrival_time_checkpoint_with_http_info(opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Get usage arrival checkpoint Retrieve the latest usage record upload to the system as epoch seconds

Parameters:

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

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



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
# File 'lib/swagger_client/api/usage_api.rb', line 202

def get_usage_arrival_time_checkpoint_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsageApi.get_usage_arrival_time_checkpoint ...'
  end
  # resource path
  local_var_path = '/v2/usage/aggregate/usageArrivalTimeCheckpoint'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsageApi#get_usage_arrival_time_checkpoint\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_usage_stats_for_all_subscriptions(from, to, opts = {}) ⇒ Array<PrepaidStats>

Get all prepaid drawdown usage stats Retrieve the current prepaid drawdown statistics for all subscriptions for a time range

Parameters:

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

    the optional parameters

Returns:



240
241
242
243
# File 'lib/swagger_client/api/usage_api.rb', line 240

def get_usage_stats_for_all_subscriptions(from, to, opts = {})
  data, _status_code, _headers = get_usage_stats_for_all_subscriptions_with_http_info(from, to, opts)
  data
end

#get_usage_stats_for_all_subscriptions_csv(from, to, opts = {}) ⇒ nil

Get all prepaid drawdown usage stats CSV Retrieve the current prepaid drawdown statistics for all subscriptions for a time range in CSV format

Parameters:

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

    the optional parameters

Returns:

  • (nil)


300
301
302
303
# File 'lib/swagger_client/api/usage_api.rb', line 300

def get_usage_stats_for_all_subscriptions_csv(from, to, opts = {})
  get_usage_stats_for_all_subscriptions_csv_with_http_info(from, to, opts)
  nil
end

#get_usage_stats_for_all_subscriptions_csv_with_http_info(from, to, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Get all prepaid drawdown usage stats CSV Retrieve the current prepaid drawdown statistics for all subscriptions for a time range in CSV format

Parameters:

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

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
# File 'lib/swagger_client/api/usage_api.rb', line 311

def get_usage_stats_for_all_subscriptions_csv_with_http_info(from, to, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsageApi.get_usage_stats_for_all_subscriptions_csv ...'
  end
  # verify the required parameter 'from' is set
  if @api_client.config.client_side_validation && from.nil?
    fail ArgumentError, "Missing the required parameter 'from' when calling UsageApi.get_usage_stats_for_all_subscriptions_csv"
  end
  # verify the required parameter 'to' is set
  if @api_client.config.client_side_validation && to.nil?
    fail ArgumentError, "Missing the required parameter 'to' when calling UsageApi.get_usage_stats_for_all_subscriptions_csv"
  end
  # resource path
  local_var_path = '/v2/usage/stats/csv'

  # query parameters
  query_params = {}
  query_params[:'from'] = from
  query_params[:'to'] = to

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream', 'application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsageApi#get_usage_stats_for_all_subscriptions_csv\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_usage_stats_for_all_subscriptions_with_http_info(from, to, opts = {}) ⇒ Array<(Array<PrepaidStats>, Fixnum, Hash)>

Get all prepaid drawdown usage stats Retrieve the current prepaid drawdown statistics for all subscriptions for a time range

Parameters:

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

    the optional parameters

Returns:

  • (Array<(Array<PrepaidStats>, Fixnum, Hash)>)

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



251
252
253
254
255
256
257
258
259
260
261
262
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
# File 'lib/swagger_client/api/usage_api.rb', line 251

def get_usage_stats_for_all_subscriptions_with_http_info(from, to, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsageApi.get_usage_stats_for_all_subscriptions ...'
  end
  # verify the required parameter 'from' is set
  if @api_client.config.client_side_validation && from.nil?
    fail ArgumentError, "Missing the required parameter 'from' when calling UsageApi.get_usage_stats_for_all_subscriptions"
  end
  # verify the required parameter 'to' is set
  if @api_client.config.client_side_validation && to.nil?
    fail ArgumentError, "Missing the required parameter 'to' when calling UsageApi.get_usage_stats_for_all_subscriptions"
  end
  # resource path
  local_var_path = '/v2/usage/stats'

  # query parameters
  query_params = {}
  query_params[:'from'] = from
  query_params[:'to'] = to

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  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 => 'Array<PrepaidStats>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsageApi#get_usage_stats_for_all_subscriptions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_usage_stats_for_subscription(subscription_id, opts = {}) ⇒ Array<PrepaidStats>

Get prepaid drawdown usage stats for subscription Retrieve the current prepaid drawdown statistics for a subscription

Parameters:

  • subscription_id

    ID of subscription to retrieve usages stats for

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

    the optional parameters

Returns:



358
359
360
361
# File 'lib/swagger_client/api/usage_api.rb', line 358

def get_usage_stats_for_subscription(subscription_id, opts = {})
  data, _status_code, _headers = get_usage_stats_for_subscription_with_http_info(subscription_id, opts)
  data
end

#get_usage_stats_for_subscription_csv(subscription_id, opts = {}) ⇒ nil

Get prepaid drawdown usage stats CSV Retrieve the current prepaid drawdown statistics for a subscription in CSV format

Parameters:

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

    the optional parameters

Returns:

  • (nil)


410
411
412
413
# File 'lib/swagger_client/api/usage_api.rb', line 410

def get_usage_stats_for_subscription_csv(subscription_id, opts = {})
  get_usage_stats_for_subscription_csv_with_http_info(subscription_id, opts)
  nil
end

#get_usage_stats_for_subscription_csv_with_http_info(subscription_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Get prepaid drawdown usage stats CSV Retrieve the current prepaid drawdown statistics for a subscription in CSV format

Parameters:

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

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
# File 'lib/swagger_client/api/usage_api.rb', line 420

def get_usage_stats_for_subscription_csv_with_http_info(subscription_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsageApi.get_usage_stats_for_subscription_csv ...'
  end
  # verify the required parameter 'subscription_id' is set
  if @api_client.config.client_side_validation && subscription_id.nil?
    fail ArgumentError, "Missing the required parameter 'subscription_id' when calling UsageApi.get_usage_stats_for_subscription_csv"
  end
  # resource path
  local_var_path = '/v2/usage/stats/{subscriptionId}/csv'.sub('{' + 'subscriptionId' + '}', subscription_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream', 'application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsageApi#get_usage_stats_for_subscription_csv\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_usage_stats_for_subscription_pdf(subscription_id, opts = {}) ⇒ nil

Get prepaid drawdown usage stats PDF Retrieve the current prepaid drawdown statistics for a subscription in PDF format

Parameters:

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

    the optional parameters

Returns:

  • (nil)


461
462
463
464
# File 'lib/swagger_client/api/usage_api.rb', line 461

def get_usage_stats_for_subscription_pdf(subscription_id, opts = {})
  get_usage_stats_for_subscription_pdf_with_http_info(subscription_id, opts)
  nil
end

#get_usage_stats_for_subscription_pdf_with_http_info(subscription_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Get prepaid drawdown usage stats PDF Retrieve the current prepaid drawdown statistics for a subscription in PDF format

Parameters:

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

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
# File 'lib/swagger_client/api/usage_api.rb', line 471

def get_usage_stats_for_subscription_pdf_with_http_info(subscription_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsageApi.get_usage_stats_for_subscription_pdf ...'
  end
  # verify the required parameter 'subscription_id' is set
  if @api_client.config.client_side_validation && subscription_id.nil?
    fail ArgumentError, "Missing the required parameter 'subscription_id' when calling UsageApi.get_usage_stats_for_subscription_pdf"
  end
  # resource path
  local_var_path = '/v2/usage/stats/{subscriptionId}/pdf'.sub('{' + 'subscriptionId' + '}', subscription_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream', 'application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsageApi#get_usage_stats_for_subscription_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_usage_stats_for_subscription_with_http_info(subscription_id, opts = {}) ⇒ Array<(Array<PrepaidStats>, Fixnum, Hash)>

Get prepaid drawdown usage stats for subscription Retrieve the current prepaid drawdown statistics for a subscription

Parameters:

  • subscription_id

    ID of subscription to retrieve usages stats for

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

    the optional parameters

Returns:

  • (Array<(Array<PrepaidStats>, Fixnum, Hash)>)

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



368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
# File 'lib/swagger_client/api/usage_api.rb', line 368

def get_usage_stats_for_subscription_with_http_info(subscription_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsageApi.get_usage_stats_for_subscription ...'
  end
  # verify the required parameter 'subscription_id' is set
  if @api_client.config.client_side_validation && subscription_id.nil?
    fail ArgumentError, "Missing the required parameter 'subscription_id' when calling UsageApi.get_usage_stats_for_subscription"
  end
  # resource path
  local_var_path = '/v2/usage/stats/{subscriptionId}'.sub('{' + 'subscriptionId' + '}', subscription_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  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 => 'Array<PrepaidStats>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsageApi#get_usage_stats_for_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#perform_on_demand_usage_aggregation(opts = {}) ⇒ nil

Aggregate raw usage Trigger the process to aggregate any remaining raw usage records

Parameters:

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

    the optional parameters

Returns:

  • (nil)


511
512
513
514
# File 'lib/swagger_client/api/usage_api.rb', line 511

def perform_on_demand_usage_aggregation(opts = {})
  perform_on_demand_usage_aggregation_with_http_info(opts)
  nil
end

#perform_on_demand_usage_aggregation_with_http_info(opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Aggregate raw usage Trigger the process to aggregate any remaining raw usage records

Parameters:

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

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
# File 'lib/swagger_client/api/usage_api.rb', line 520

def perform_on_demand_usage_aggregation_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsageApi.perform_on_demand_usage_aggregation ...'
  end
  # resource path
  local_var_path = '/v2/usage/aggregate'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsageApi#perform_on_demand_usage_aggregation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#upload_subscription_usage_csv(opts = {}) ⇒ UsageBatchInsertResult

Upload usage record CSV Upload usage records in CSV file. Each row of the file represents a single usage record

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :file (File)

Returns:



557
558
559
560
# File 'lib/swagger_client/api/usage_api.rb', line 557

def upload_subscription_usage_csv(opts = {})
  data, _status_code, _headers = upload_subscription_usage_csv_with_http_info(opts)
  data
end

#upload_subscription_usage_csv_with_http_info(opts = {}) ⇒ Array<(UsageBatchInsertResult, Fixnum, Hash)>

Upload usage record CSV Upload usage records in CSV file. Each row of the file represents a single usage record

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :file (File)

Returns:

  • (Array<(UsageBatchInsertResult, Fixnum, Hash)>)

    UsageBatchInsertResult data, response status code and response headers



567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
# File 'lib/swagger_client/api/usage_api.rb', line 567

def upload_subscription_usage_csv_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UsageApi.upload_subscription_usage_csv ...'
  end
  # resource path
  local_var_path = '/v2/usage/csv'

  # 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(['multipart/form-data'])

  # form parameters
  form_params = {}
  form_params['file'] = opts[:'file'] if !opts[:'file'].nil?

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  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 => 'UsageBatchInsertResult')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UsageApi#upload_subscription_usage_csv\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end