Class: SubskribeDevClient::UsageApi
- Inherits:
-
Object
- Object
- SubskribeDevClient::UsageApi
- Defined in:
- lib/subskribe_dev/api/usage_api.rb,
lib/subskribe_dev2/api/usage_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#add_and_apply_bulk_payments_csv(opts = {}) ⇒ BulkPaymentUploadResult
Add and apply bulk payments to invoices CSV Bulk upload payments to invoices in CSV file.
-
#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.
-
#add_usage(opts = {}) ⇒ UsageBatchInsertResult
Add usage record Load usage records into the system.
-
#add_usage_with_http_info(opts = {}) ⇒ Array<(UsageBatchInsertResult, Fixnum, Hash)>
Add usage record Load usage records into the system.
-
#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.
-
#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.
-
#get_usage_arrival_time_checkpoint(opts = {}) ⇒ nil
Get usage arrival checkpoint Retrieve the latest usage record upload to the system as epoch seconds.
-
#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.
-
#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.
-
#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.
-
#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.
-
#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.
-
#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.
-
#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.
-
#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.
-
#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.
-
#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.
-
#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.
-
#initialize(api_client = ApiClient.default) ⇒ UsageApi
constructor
A new instance of UsageApi.
-
#perform_on_demand_usage_aggregation(opts = {}) ⇒ nil
Aggregate raw usage Trigger the process to aggregate any remaining raw usage records.
-
#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.
-
#upload_subscription_usage_csv(opts = {}) ⇒ UsageBatchInsertResult
Upload usage record CSV Upload usage records in CSV file.
-
#upload_subscription_usage_csv_with_http_info(opts = {}) ⇒ Array<(UsageBatchInsertResult, Fixnum, Hash)>
Upload usage record CSV Upload usage records in CSV file.
Constructor Details
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/subskribe_dev/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
27 28 29 30 |
# File 'lib/subskribe_dev/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
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/subskribe_dev/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
78 79 80 81 |
# File 'lib/subskribe_dev/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
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/subskribe_dev/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
130 131 132 133 |
# File 'lib/subskribe_dev/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
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/subskribe_dev/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
193 194 195 196 |
# File 'lib/subskribe_dev/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
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/subskribe_dev/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
240 241 242 243 |
# File 'lib/subskribe_dev/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
300 301 302 303 |
# File 'lib/subskribe_dev/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
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/subskribe_dev/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
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/subskribe_dev/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
358 359 360 361 |
# File 'lib/subskribe_dev/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
410 411 412 413 |
# File 'lib/subskribe_dev/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
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/subskribe_dev/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
461 462 463 464 |
# File 'lib/subskribe_dev/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
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/subskribe_dev/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
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/subskribe_dev/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
511 512 513 514 |
# File 'lib/subskribe_dev/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
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/subskribe_dev/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
557 558 559 560 |
# File 'lib/subskribe_dev/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
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/subskribe_dev/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 |