Class: Bfwd::AnalyticsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/bf_ruby2/api/analytics_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ AnalyticsApi

Returns a new instance of AnalyticsApi.



19
20
21
# File 'lib/bf_ruby2/api/analytics_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/bf_ruby2/api/analytics_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#get_account_debts(debts_per_account, opts = {}) ⇒ AccountPaymentsResultPagedMetadata

Gets outstanding debts per account, within a date range. : "Get account debts","response" : "getAccountDebts.html"

Parameters:

  • debts_per_account

    The payments-per-account object.

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

    the optional parameters

Returns:



28
29
30
31
# File 'lib/bf_ruby2/api/analytics_api.rb', line 28

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

#get_account_debts_with_http_info(debts_per_account, opts = {}) ⇒ Array<(AccountPaymentsResultPagedMetadata, Fixnum, Hash)>

Gets outstanding debts per account, within a date range. : &quot;Get account debts&quot;,&quot;response&quot; : &quot;getAccountDebts.html&quot;

Parameters:

  • debts_per_account

    The payments-per-account object.

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

    the optional parameters

Returns:



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
73
74
75
76
# File 'lib/bf_ruby2/api/analytics_api.rb', line 38

def (, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AnalyticsApi.get_account_debts ..."
  end
  # verify the required parameter 'debts_per_account' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'debts_per_account' when calling AnalyticsApi.get_account_debts"
  end
  # resource path
  local_var_path = "/analytics/payments/accounts/outstanding"

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json; charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=utf-8'])

  # form parameters
  form_params = {}

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

#get_account_ltv(account_id, end_datetime, opts = {}) ⇒ AccountLTVResultPagedMetadata

Gets an account’s life-time value, as of a given end date. account life-time value","response":"getAccountLTV.html"

Parameters:

  • account_id

    The id of the account.

  • end_datetime

    The UTC DateTime specifying the end of the result period.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first amendment to return. (default to 0)

  • :records (Integer)

    The maximum number of amendments to return. (default to 8766)

  • :order_by (String)

    Specify a field used to order the result set. (default to created)

  • :order (String)

    The direction of any ordering, either ASC or DESC. (default to ASC)

Returns:



89
90
91
92
# File 'lib/bf_ruby2/api/analytics_api.rb', line 89

def (, end_datetime, opts = {})
  data, _status_code, _headers = (, end_datetime, opts)
  return data
end

#get_account_ltv_with_http_info(account_id, end_datetime, opts = {}) ⇒ Array<(AccountLTVResultPagedMetadata, Fixnum, Hash)>

Gets an account&#39;s life-time value, as of a given end date. account life-time value&quot;,&quot;response&quot;:&quot;getAccountLTV.html&quot;

Parameters:

  • account_id

    The id of the account.

  • end_datetime

    The UTC DateTime specifying the end of the result period.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first amendment to return.

  • :records (Integer)

    The maximum number of amendments to return.

  • :order_by (String)

    Specify a field used to order the result set.

  • :order (String)

    The direction of any ordering, either ASC or DESC.

Returns:



105
106
107
108
109
110
111
112
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
# File 'lib/bf_ruby2/api/analytics_api.rb', line 105

def (, end_datetime, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AnalyticsApi.get_account_ltv ..."
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling AnalyticsApi.get_account_ltv"
  end
  # verify the required parameter 'end_datetime' is set
  if @api_client.config.client_side_validation && end_datetime.nil?
    fail ArgumentError, "Missing the required parameter 'end_datetime' when calling AnalyticsApi.get_account_ltv"
  end
  if @api_client.config.client_side_validation && opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = "/analytics/account-ltv/{account-id}/{end-datetime}".sub('{' + 'account-id' + '}', .to_s).sub('{' + 'end-datetime' + '}', end_datetime.to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
  query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?

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

  # form parameters
  form_params = {}

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

#get_account_payments(payments_per_account, opts = {}) ⇒ AccountPaymentsResultPagedMetadata

Gets hourly payments per product, within a date range. : "Get payments per account","response" : "getAccountPayments.html"

Parameters:

  • payments_per_account

    The payments-per-account object.

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

    the optional parameters

Returns:



160
161
162
163
# File 'lib/bf_ruby2/api/analytics_api.rb', line 160

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

#get_account_payments_with_http_info(payments_per_account, opts = {}) ⇒ Array<(AccountPaymentsResultPagedMetadata, Fixnum, Hash)>

Gets hourly payments per product, within a date range. : &quot;Get payments per account&quot;,&quot;response&quot; : &quot;getAccountPayments.html&quot;

Parameters:

  • payments_per_account

    The payments-per-account object.

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

    the optional parameters

Returns:



170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
# File 'lib/bf_ruby2/api/analytics_api.rb', line 170

def (, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AnalyticsApi.get_account_payments ..."
  end
  # verify the required parameter 'payments_per_account' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'payments_per_account' when calling AnalyticsApi.get_account_payments"
  end
  # resource path
  local_var_path = "/analytics/payments/accounts"

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json; charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=utf-8'])

  # form parameters
  form_params = {}

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

#get_billforward_managed_payments(start_datetime, end_datetime, opts = {}) ⇒ BillforwardManagedPaymentsResultPagedMetadata

Gets all payments managed by BillForward, within a date range. managed payments","response":"getManagedPayments.html"

Parameters:

  • start_datetime

    The UTC DateTime specifying the start of the result period.

  • end_datetime

    The UTC DateTime specifying the end of the result period.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first amendment to return. (default to 0)

  • :records (Integer)

    The maximum number of amendments to return. (default to 8766)

  • :order_by (String)

    Specify a field used to order the result set. (default to created)

  • :order (String)

    The direction of any ordering, either ASC or DESC. (default to ASC)

Returns:



221
222
223
224
# File 'lib/bf_ruby2/api/analytics_api.rb', line 221

def get_billforward_managed_payments(start_datetime, end_datetime, opts = {})
  data, _status_code, _headers = get_billforward_managed_payments_with_http_info(start_datetime, end_datetime, opts)
  return data
end

#get_billforward_managed_payments_with_http_info(start_datetime, end_datetime, opts = {}) ⇒ Array<(BillforwardManagedPaymentsResultPagedMetadata, Fixnum, Hash)>

Gets all payments managed by BillForward, within a date range. managed payments&quot;,&quot;response&quot;:&quot;getManagedPayments.html&quot;

Parameters:

  • start_datetime

    The UTC DateTime specifying the start of the result period.

  • end_datetime

    The UTC DateTime specifying the end of the result period.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first amendment to return.

  • :records (Integer)

    The maximum number of amendments to return.

  • :order_by (String)

    Specify a field used to order the result set.

  • :order (String)

    The direction of any ordering, either ASC or DESC.

Returns:



237
238
239
240
241
242
243
244
245
246
247
248
249
250
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
# File 'lib/bf_ruby2/api/analytics_api.rb', line 237

def get_billforward_managed_payments_with_http_info(start_datetime, end_datetime, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AnalyticsApi.get_billforward_managed_payments ..."
  end
  # verify the required parameter 'start_datetime' is set
  if @api_client.config.client_side_validation && start_datetime.nil?
    fail ArgumentError, "Missing the required parameter 'start_datetime' when calling AnalyticsApi.get_billforward_managed_payments"
  end
  # verify the required parameter 'end_datetime' is set
  if @api_client.config.client_side_validation && end_datetime.nil?
    fail ArgumentError, "Missing the required parameter 'end_datetime' when calling AnalyticsApi.get_billforward_managed_payments"
  end
  if @api_client.config.client_side_validation && opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = "/analytics/billforward-managed-payments/{start-datetime}/{end-datetime}".sub('{' + 'start-datetime' + '}', start_datetime.to_s).sub('{' + 'end-datetime' + '}', end_datetime.to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
  query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?

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

  # form parameters
  form_params = {}

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

#get_churn(start_datetime, end_datetime, opts = {}) ⇒ CassChurnResultPagedMetadata

Gets churn, within a date range. churn","response":"getChurn.html"

Parameters:

  • start_datetime

    The UTC DateTime specifying the start of the result period.

  • end_datetime

    The UTC DateTime specifying the end of the result period.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first amendment to return. (default to 0)

  • :records (Integer)

    The maximum number of amendments to return. (default to 8766)

  • :order_by (String)

    Specify a field used to order the result set. (default to created)

  • :order (String)

    The direction of any ordering, either ASC or DESC. (default to ASC)

Returns:



298
299
300
301
# File 'lib/bf_ruby2/api/analytics_api.rb', line 298

def get_churn(start_datetime, end_datetime, opts = {})
  data, _status_code, _headers = get_churn_with_http_info(start_datetime, end_datetime, opts)
  return data
end

#get_churn_with_http_info(start_datetime, end_datetime, opts = {}) ⇒ Array<(CassChurnResultPagedMetadata, Fixnum, Hash)>

Gets churn, within a date range. churn&quot;,&quot;response&quot;:&quot;getChurn.html&quot;

Parameters:

  • start_datetime

    The UTC DateTime specifying the start of the result period.

  • end_datetime

    The UTC DateTime specifying the end of the result period.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first amendment to return.

  • :records (Integer)

    The maximum number of amendments to return.

  • :order_by (String)

    Specify a field used to order the result set.

  • :order (String)

    The direction of any ordering, either ASC or DESC.

Returns:



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
353
354
355
356
357
358
359
360
361
362
# File 'lib/bf_ruby2/api/analytics_api.rb', line 314

def get_churn_with_http_info(start_datetime, end_datetime, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AnalyticsApi.get_churn ..."
  end
  # verify the required parameter 'start_datetime' is set
  if @api_client.config.client_side_validation && start_datetime.nil?
    fail ArgumentError, "Missing the required parameter 'start_datetime' when calling AnalyticsApi.get_churn"
  end
  # verify the required parameter 'end_datetime' is set
  if @api_client.config.client_side_validation && end_datetime.nil?
    fail ArgumentError, "Missing the required parameter 'end_datetime' when calling AnalyticsApi.get_churn"
  end
  if @api_client.config.client_side_validation && opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = "/analytics/churn/{start-datetime}/{end-datetime}".sub('{' + 'start-datetime' + '}', start_datetime.to_s).sub('{' + 'end-datetime' + '}', end_datetime.to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
  query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?

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

  # form parameters
  form_params = {}

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

#get_debts(start_datetime, end_datetime, opts = {}) ⇒ DebtsResultPagedMetadata

Gets debts within a date range. debts","response":"getDebts.html"

Parameters:

  • start_datetime

    The UTC DateTime specifying the start of the result period.

  • end_datetime

    The UTC DateTime specifying the end of the result period.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first amendment to return. (default to 0)

  • :records (Integer)

    The maximum number of amendments to return. (default to 8766)

  • :order_by (String)

    Specify a field used to order the result set. (default to created)

  • :order (String)

    The direction of any ordering, either ASC or DESC. (default to ASC)

Returns:



375
376
377
378
# File 'lib/bf_ruby2/api/analytics_api.rb', line 375

def get_debts(start_datetime, end_datetime, opts = {})
  data, _status_code, _headers = get_debts_with_http_info(start_datetime, end_datetime, opts)
  return data
end

#get_debts_with_http_info(start_datetime, end_datetime, opts = {}) ⇒ Array<(DebtsResultPagedMetadata, Fixnum, Hash)>

Gets debts within a date range. debts&quot;,&quot;response&quot;:&quot;getDebts.html&quot;

Parameters:

  • start_datetime

    The UTC DateTime specifying the start of the result period.

  • end_datetime

    The UTC DateTime specifying the end of the result period.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first amendment to return.

  • :records (Integer)

    The maximum number of amendments to return.

  • :order_by (String)

    Specify a field used to order the result set.

  • :order (String)

    The direction of any ordering, either ASC or DESC.

Returns:

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

    DebtsResultPagedMetadata data, response status code and response headers



391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
# File 'lib/bf_ruby2/api/analytics_api.rb', line 391

def get_debts_with_http_info(start_datetime, end_datetime, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AnalyticsApi.get_debts ..."
  end
  # verify the required parameter 'start_datetime' is set
  if @api_client.config.client_side_validation && start_datetime.nil?
    fail ArgumentError, "Missing the required parameter 'start_datetime' when calling AnalyticsApi.get_debts"
  end
  # verify the required parameter 'end_datetime' is set
  if @api_client.config.client_side_validation && end_datetime.nil?
    fail ArgumentError, "Missing the required parameter 'end_datetime' when calling AnalyticsApi.get_debts"
  end
  if @api_client.config.client_side_validation && opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = "/analytics/payments/outstanding/{start-datetime}/{end-datetime}".sub('{' + 'start-datetime' + '}', start_datetime.to_s).sub('{' + 'end-datetime' + '}', end_datetime.to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
  query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?

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

  # form parameters
  form_params = {}

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

#get_payments(start_datetime, end_datetime, opts = {}) ⇒ CassPaymentResultPagedMetadata

Gets payments within a date range. all payments","response":"getPayments.html"

Parameters:

  • start_datetime

    The UTC DateTime specifying the start of the result period.

  • end_datetime

    The UTC DateTime specifying the end of the result period.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first amendment to return. (default to 0)

  • :records (Integer)

    The maximum number of amendments to return. (default to 8766)

  • :order_by (String)

    Specify a field used to order the result set. (default to created)

  • :order (String)

    The direction of any ordering, either ASC or DESC. (default to ASC)

Returns:



452
453
454
455
# File 'lib/bf_ruby2/api/analytics_api.rb', line 452

def get_payments(start_datetime, end_datetime, opts = {})
  data, _status_code, _headers = get_payments_with_http_info(start_datetime, end_datetime, opts)
  return data
end

#get_payments_with_http_info(start_datetime, end_datetime, opts = {}) ⇒ Array<(CassPaymentResultPagedMetadata, Fixnum, Hash)>

Gets payments within a date range. all payments&quot;,&quot;response&quot;:&quot;getPayments.html&quot;

Parameters:

  • start_datetime

    The UTC DateTime specifying the start of the result period.

  • end_datetime

    The UTC DateTime specifying the end of the result period.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first amendment to return.

  • :records (Integer)

    The maximum number of amendments to return.

  • :order_by (String)

    Specify a field used to order the result set.

  • :order (String)

    The direction of any ordering, either ASC or DESC.

Returns:



468
469
470
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
507
508
509
510
511
512
513
514
515
516
# File 'lib/bf_ruby2/api/analytics_api.rb', line 468

def get_payments_with_http_info(start_datetime, end_datetime, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AnalyticsApi.get_payments ..."
  end
  # verify the required parameter 'start_datetime' is set
  if @api_client.config.client_side_validation && start_datetime.nil?
    fail ArgumentError, "Missing the required parameter 'start_datetime' when calling AnalyticsApi.get_payments"
  end
  # verify the required parameter 'end_datetime' is set
  if @api_client.config.client_side_validation && end_datetime.nil?
    fail ArgumentError, "Missing the required parameter 'end_datetime' when calling AnalyticsApi.get_payments"
  end
  if @api_client.config.client_side_validation && opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = "/analytics/payments/{start-datetime}/{end-datetime}".sub('{' + 'start-datetime' + '}', start_datetime.to_s).sub('{' + 'end-datetime' + '}', end_datetime.to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
  query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?

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

  # form parameters
  form_params = {}

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

#get_product_payments(payments_per_product, opts = {}) ⇒ ProductPaymentsResultPagedMetadata

Gets hourly payments per product, within a date range. : "Get payments per product","response" : "getProductPayments.html"

Parameters:

  • payments_per_product

    The payments-per-product object.

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

    the optional parameters

Returns:



523
524
525
526
# File 'lib/bf_ruby2/api/analytics_api.rb', line 523

def get_product_payments(payments_per_product, opts = {})
  data, _status_code, _headers = get_product_payments_with_http_info(payments_per_product, opts)
  return data
end

#get_product_payments_with_http_info(payments_per_product, opts = {}) ⇒ Array<(ProductPaymentsResultPagedMetadata, Fixnum, Hash)>

Gets hourly payments per product, within a date range. : &quot;Get payments per product&quot;,&quot;response&quot; : &quot;getProductPayments.html&quot;

Parameters:

  • payments_per_product

    The payments-per-product object.

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

    the optional parameters

Returns:



533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
# File 'lib/bf_ruby2/api/analytics_api.rb', line 533

def get_product_payments_with_http_info(payments_per_product, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AnalyticsApi.get_product_payments ..."
  end
  # verify the required parameter 'payments_per_product' is set
  if @api_client.config.client_side_validation && payments_per_product.nil?
    fail ArgumentError, "Missing the required parameter 'payments_per_product' when calling AnalyticsApi.get_product_payments"
  end
  # resource path
  local_var_path = "/analytics/payments-per-product"

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json; charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=utf-8'])

  # form parameters
  form_params = {}

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

#get_product_rate_plan_payments(payments_per_product_rate_plan, opts = {}) ⇒ ProductRatePlanPaymentsResultPagedMetadata

Gets hourly payments per product, within a date range. : "Get payments per rate plan","response" : "getRatePlanPayments.html"

Parameters:

  • payments_per_product_rate_plan

    The payments-per-product-rate-plan object.

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

    the optional parameters

Returns:



578
579
580
581
# File 'lib/bf_ruby2/api/analytics_api.rb', line 578

def get_product_rate_plan_payments(payments_per_product_rate_plan, opts = {})
  data, _status_code, _headers = get_product_rate_plan_payments_with_http_info(payments_per_product_rate_plan, opts)
  return data
end

#get_product_rate_plan_payments_with_http_info(payments_per_product_rate_plan, opts = {}) ⇒ Array<(ProductRatePlanPaymentsResultPagedMetadata, Fixnum, Hash)>

Gets hourly payments per product, within a date range. : &quot;Get payments per rate plan&quot;,&quot;response&quot; : &quot;getRatePlanPayments.html&quot;

Parameters:

  • payments_per_product_rate_plan

    The payments-per-product-rate-plan object.

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

    the optional parameters

Returns:



588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
# File 'lib/bf_ruby2/api/analytics_api.rb', line 588

def get_product_rate_plan_payments_with_http_info(payments_per_product_rate_plan, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AnalyticsApi.get_product_rate_plan_payments ..."
  end
  # verify the required parameter 'payments_per_product_rate_plan' is set
  if @api_client.config.client_side_validation && payments_per_product_rate_plan.nil?
    fail ArgumentError, "Missing the required parameter 'payments_per_product_rate_plan' when calling AnalyticsApi.get_product_rate_plan_payments"
  end
  # resource path
  local_var_path = "/analytics/payments/product-rate-plan"

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json; charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=utf-8'])

  # form parameters
  form_params = {}

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

#get_subscription_ltv(subscription_id, end_datetime, opts = {}) ⇒ SubscriptionLTVResultPagedMetadata

Gets a subscription’s life-time value, as of a given end date. sub life-time value","response":"getSubscriptionLTV.html"

Parameters:

  • subscription_id

    The id of the subscription.

  • end_datetime

    The UTC DateTime specifying the end of the result period.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first amendment to return. (default to 0)

  • :records (Integer)

    The maximum number of amendments to return. (default to 8766)

  • :order_by (String)

    Specify a field used to order the result set. (default to created)

  • :order (String)

    The direction of any ordering, either ASC or DESC. (default to ASC)

Returns:



639
640
641
642
# File 'lib/bf_ruby2/api/analytics_api.rb', line 639

def get_subscription_ltv(subscription_id, end_datetime, opts = {})
  data, _status_code, _headers = get_subscription_ltv_with_http_info(subscription_id, end_datetime, opts)
  return data
end

#get_subscription_ltv_with_http_info(subscription_id, end_datetime, opts = {}) ⇒ Array<(SubscriptionLTVResultPagedMetadata, Fixnum, Hash)>

Gets a subscription&#39;s life-time value, as of a given end date. sub life-time value&quot;,&quot;response&quot;:&quot;getSubscriptionLTV.html&quot;

Parameters:

  • subscription_id

    The id of the subscription.

  • end_datetime

    The UTC DateTime specifying the end of the result period.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first amendment to return.

  • :records (Integer)

    The maximum number of amendments to return.

  • :order_by (String)

    Specify a field used to order the result set.

  • :order (String)

    The direction of any ordering, either ASC or DESC.

Returns:



655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
# File 'lib/bf_ruby2/api/analytics_api.rb', line 655

def get_subscription_ltv_with_http_info(subscription_id, end_datetime, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AnalyticsApi.get_subscription_ltv ..."
  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 AnalyticsApi.get_subscription_ltv"
  end
  # verify the required parameter 'end_datetime' is set
  if @api_client.config.client_side_validation && end_datetime.nil?
    fail ArgumentError, "Missing the required parameter 'end_datetime' when calling AnalyticsApi.get_subscription_ltv"
  end
  if @api_client.config.client_side_validation && opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = "/analytics/subscription-ltv/{subscription-id}/{end-datetime}".sub('{' + 'subscription-id' + '}', subscription_id.to_s).sub('{' + 'end-datetime' + '}', end_datetime.to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
  query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?

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

  # form parameters
  form_params = {}

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

#get_upgrades(start_datetime, end_datetime, opts = {}) ⇒ CassUpgradeResultPagedMetadata

Gets upgrades, within a date range. upgrades","response":"getUpgrades.html"

Parameters:

  • start_datetime

    The UTC DateTime specifying the start of the result period.

  • end_datetime

    The UTC DateTime specifying the end of the result period.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first amendment to return. (default to 0)

  • :records (Integer)

    The maximum number of amendments to return. (default to 8766)

  • :order_by (String)

    Specify a field used to order the result set. (default to created)

  • :order (String)

    The direction of any ordering, either ASC or DESC. (default to ASC)

Returns:



716
717
718
719
# File 'lib/bf_ruby2/api/analytics_api.rb', line 716

def get_upgrades(start_datetime, end_datetime, opts = {})
  data, _status_code, _headers = get_upgrades_with_http_info(start_datetime, end_datetime, opts)
  return data
end

#get_upgrades_with_http_info(start_datetime, end_datetime, opts = {}) ⇒ Array<(CassUpgradeResultPagedMetadata, Fixnum, Hash)>

Gets upgrades, within a date range. upgrades&quot;,&quot;response&quot;:&quot;getUpgrades.html&quot;

Parameters:

  • start_datetime

    The UTC DateTime specifying the start of the result period.

  • end_datetime

    The UTC DateTime specifying the end of the result period.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

    A list of organization-IDs used to restrict the scope of API calls.

  • :offset (Integer)

    The offset from the first amendment to return.

  • :records (Integer)

    The maximum number of amendments to return.

  • :order_by (String)

    Specify a field used to order the result set.

  • :order (String)

    The direction of any ordering, either ASC or DESC.

Returns:



732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
# File 'lib/bf_ruby2/api/analytics_api.rb', line 732

def get_upgrades_with_http_info(start_datetime, end_datetime, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AnalyticsApi.get_upgrades ..."
  end
  # verify the required parameter 'start_datetime' is set
  if @api_client.config.client_side_validation && start_datetime.nil?
    fail ArgumentError, "Missing the required parameter 'start_datetime' when calling AnalyticsApi.get_upgrades"
  end
  # verify the required parameter 'end_datetime' is set
  if @api_client.config.client_side_validation && end_datetime.nil?
    fail ArgumentError, "Missing the required parameter 'end_datetime' when calling AnalyticsApi.get_upgrades"
  end
  if @api_client.config.client_side_validation && opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = "/analytics/upgrades/{start-datetime}/{end-datetime}".sub('{' + 'start-datetime' + '}', start_datetime.to_s).sub('{' + 'end-datetime' + '}', end_datetime.to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
  query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?

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

  # form parameters
  form_params = {}

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