Class: SubskribeDevClient::RevenueRecognitionApi

Inherits:
Object
  • Object
show all
Defined in:
lib/subskribe_dev/api/revenue_recognition_api.rb,
lib/subskribe_dev2/api/revenue_recognition_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ RevenueRecognitionApi

Returns a new instance of RevenueRecognitionApi.



19
20
21
# File 'lib/subskribe_dev/api/revenue_recognition_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/subskribe_dev/api/revenue_recognition_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#add_recognition_rule(body, opts = {}) ⇒ nil

Create a revenue recognition rule Creates a revenue recognition rule.

Parameters:

  • body

    recognition rule details

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

    the optional parameters

Returns:

  • (nil)


27
28
29
30
# File 'lib/subskribe_dev/api/revenue_recognition_api.rb', line 27

def add_recognition_rule(body, opts = {})
  add_recognition_rule_with_http_info(body, opts)
  nil
end

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

Create a revenue recognition rule Creates a revenue recognition rule.

Parameters:

  • body

    recognition rule details

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

    the optional parameters

Returns:

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

    nil, 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
73
74
# File 'lib/subskribe_dev/api/revenue_recognition_api.rb', line 37

def add_recognition_rule_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RevenueRecognitionApi.add_recognition_rule ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling RevenueRecognitionApi.add_recognition_rule"
  end
  # resource path
  local_var_path = '/revrec/rules'

  # 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(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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: RevenueRecognitionApi#add_recognition_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_recognition_event(body, opts = {}) ⇒ nil

Create a revenue recognition event Creates a revenue recognition event, only if it is different from the previous event for same subscription and charge.

Parameters:

  • body

    recognition event details

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

    the optional parameters

Returns:

  • (nil)


80
81
82
83
# File 'lib/subskribe_dev/api/revenue_recognition_api.rb', line 80

def create_recognition_event(body, opts = {})
  create_recognition_event_with_http_info(body, opts)
  nil
end

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

Create a revenue recognition event Creates a revenue recognition event, only if it is different from the previous event for same subscription and charge.

Parameters:

  • body

    recognition event details

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
123
124
125
# File 'lib/subskribe_dev/api/revenue_recognition_api.rb', line 90

def create_recognition_event_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RevenueRecognitionApi.create_recognition_event ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling RevenueRecognitionApi.create_recognition_event"
  end
  # resource path
  local_var_path = '/revrec/events'

  # 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 = @api_client.object_to_http_body(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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: RevenueRecognitionApi#create_recognition_event\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_rule(rule_id, opts = {}) ⇒ RecognitionRule

Delete a recognition rule Deletes a recognition rule. Note you can’t delete a recognition rule that’s in use.

Parameters:

  • rule_id

    id of the recognition rule

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

    the optional parameters

Returns:



131
132
133
134
# File 'lib/subskribe_dev/api/revenue_recognition_api.rb', line 131

def delete_rule(rule_id, opts = {})
  data, _status_code, _headers = delete_rule_with_http_info(rule_id, opts)
  data
end

#delete_rule_with_http_info(rule_id, opts = {}) ⇒ Array<(RecognitionRule, Fixnum, Hash)>

Delete a recognition rule Deletes a recognition rule. Note you can&#39;t delete a recognition rule that&#39;s in use.

Parameters:

  • rule_id

    id of the recognition rule

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

    the optional parameters

Returns:

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

    RecognitionRule data, response status code and response headers



141
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
# File 'lib/subskribe_dev/api/revenue_recognition_api.rb', line 141

def delete_rule_with_http_info(rule_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RevenueRecognitionApi.delete_rule ...'
  end
  # verify the required parameter 'rule_id' is set
  if @api_client.config.client_side_validation && rule_id.nil?
    fail ArgumentError, "Missing the required parameter 'rule_id' when calling RevenueRecognitionApi.delete_rule"
  end
  # resource path
  local_var_path = '/revrec/rules/{ruleId}'.sub('{' + 'ruleId' + '}', rule_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(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'RecognitionRule')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: RevenueRecognitionApi#delete_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_recognition_events_by_subscription_id_charge_id(subscription_id, charge_id, opts = {}) ⇒ Array<RecognitionEventCompletion>

Get revenue recognition events Gets revenue recognition events for the specified subscription and charge.

Parameters:

  • subscription_id

    id of the subscription

  • charge_id

    id of the charge

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

    the optional parameters

Options Hash (opts):

  • :accounting_period_id (String)

    id of the accounting period to limit events to

Returns:



185
186
187
188
# File 'lib/subskribe_dev/api/revenue_recognition_api.rb', line 185

def get_recognition_events_by_subscription_id_charge_id(subscription_id, charge_id, opts = {})
  data, _status_code, _headers = get_recognition_events_by_subscription_id_charge_id_with_http_info(subscription_id, charge_id, opts)
  data
end

#get_recognition_events_by_subscription_id_charge_id_with_http_info(subscription_id, charge_id, opts = {}) ⇒ Array<(Array<RecognitionEventCompletion>, Fixnum, Hash)>

Get revenue recognition events Gets revenue recognition events for the specified subscription and charge.

Parameters:

  • subscription_id

    id of the subscription

  • charge_id

    id of the charge

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

    the optional parameters

Options Hash (opts):

  • :accounting_period_id (String)

    id of the accounting period to limit events to

Returns:

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

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



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

def get_recognition_events_by_subscription_id_charge_id_with_http_info(subscription_id, charge_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RevenueRecognitionApi.get_recognition_events_by_subscription_id_charge_id ...'
  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 RevenueRecognitionApi.get_recognition_events_by_subscription_id_charge_id"
  end
  # verify the required parameter 'charge_id' is set
  if @api_client.config.client_side_validation && charge_id.nil?
    fail ArgumentError, "Missing the required parameter 'charge_id' when calling RevenueRecognitionApi.get_recognition_events_by_subscription_id_charge_id"
  end
  # resource path
  local_var_path = '/revrec/events'

  # query parameters
  query_params = {}
  query_params[:'subscriptionId'] = subscription_id
  query_params[:'chargeId'] = charge_id
  query_params[:'accountingPeriodId'] = opts[:'accounting_period_id'] if !opts[:'accounting_period_id'].nil?

  # 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<RecognitionEventCompletion>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: RevenueRecognitionApi#get_recognition_events_by_subscription_id_charge_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_recognition_rule_by_id(opts = {}) ⇒ nil

Get revenue recognition rules Get revenue recognition rules.

Parameters:

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

    the optional parameters

Returns:

  • (nil)


246
247
248
249
# File 'lib/subskribe_dev/api/revenue_recognition_api.rb', line 246

def get_recognition_rule_by_id(id, opts = {})
  get_recognition_rule_by_id_with_http_info(id, opts)
  nil
end

#get_recognition_rule_by_id1(id, opts = {}) ⇒ nil

Get revenue recognition rule Get a revenue recognition rule using id.

Parameters:

  • id

    id of the recognition rule

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

    the optional parameters

Returns:

  • (nil)


296
297
298
299
# File 'lib/subskribe_dev/api/revenue_recognition_api.rb', line 296

def get_recognition_rule_by_id1(opts = {})
  get_recognition_rule_by_id1_with_http_info(opts)
  nil
end

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

Get revenue recognition rule Get a revenue recognition rule using id.

Parameters:

  • id

    id of the recognition rule

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



305
306
307
308
309
310
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
# File 'lib/subskribe_dev/api/revenue_recognition_api.rb', line 305

def get_recognition_rule_by_id1_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RevenueRecognitionApi.get_recognition_rule_by_id1 ...'
  end
  # resource path
  local_var_path = '/revrec/rules'

  # 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: RevenueRecognitionApi#get_recognition_rule_by_id1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

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

Get revenue recognition rules Get revenue recognition rules.

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
# File 'lib/subskribe_dev/api/revenue_recognition_api.rb', line 256

def get_recognition_rule_by_id_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RevenueRecognitionApi.get_recognition_rule_by_id ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling RevenueRecognitionApi.get_recognition_rule_by_id"
  end
  # resource path
  local_var_path = '/revrec/rules/{id}'.sub('{' + 'id' + '}', 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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: RevenueRecognitionApi#get_recognition_rule_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_revenue_waterfall(opts = {}) ⇒ nil

Download waterfall report Downloads a revenue waterfall report in csv format.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :start_date (Integer)

    report start date as unix timestamp

  • :end_date (Integer)

    report end date as unix timestamp

Returns:

  • (nil)


343
344
345
346
# File 'lib/subskribe_dev/api/revenue_recognition_api.rb', line 343

def get_revenue_waterfall(opts = {})
  get_revenue_waterfall_with_http_info(opts)
  nil
end

#get_revenue_waterfall_report_v2(opts = {}) ⇒ nil

Download waterfall report Downloads a revenue waterfall report in csv format.

Parameters:

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

    the optional parameters

Returns:

  • (nil)


392
393
394
395
# File 'lib/subskribe_dev/api/revenue_recognition_api.rb', line 392

def get_revenue_waterfall_report_v2(opts = {})
  get_revenue_waterfall_report_v2_with_http_info(opts)
  nil
end

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

Download waterfall report Downloads a revenue waterfall report in csv format.

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
# File 'lib/subskribe_dev/api/revenue_recognition_api.rb', line 401

def get_revenue_waterfall_report_v2_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RevenueRecognitionApi.get_revenue_waterfall_report_v2 ...'
  end
  # resource path
  local_var_path = '/revrec/waterfall/v2'

  # 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: RevenueRecognitionApi#get_revenue_waterfall_report_v2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

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

Download waterfall report Downloads a revenue waterfall report in csv format.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :start_date (Integer)

    report start date as unix timestamp

  • :end_date (Integer)

    report end date as unix timestamp

Returns:

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

    nil, response status code and response headers



354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
# File 'lib/subskribe_dev/api/revenue_recognition_api.rb', line 354

def get_revenue_waterfall_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RevenueRecognitionApi.get_revenue_waterfall ...'
  end
  # resource path
  local_var_path = '/revrec/waterfall'

  # query parameters
  query_params = {}
  query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil?
  query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil?

  # 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: RevenueRecognitionApi#get_revenue_waterfall\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#upload_completion_events(opts = {}) ⇒ nil

Upload revenue events Uploads revenue events from a csv file. The format of the file is Subscription.Id,Charge.Id,Alias.Id,RevrecEvent.PercentComplete Percent complete should be a decimal.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :file (File)

Returns:

  • (nil)


438
439
440
441
# File 'lib/subskribe_dev/api/revenue_recognition_api.rb', line 438

def upload_completion_events(opts = {})
  upload_completion_events_with_http_info(opts)
  nil
end

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

Upload revenue events Uploads revenue events from a csv file. The format of the file is Subscription.Id,Charge.Id,Alias.Id,RevrecEvent.PercentComplete Percent complete should be a decimal.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :file (File)

Returns:

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

    nil, response status code and response headers



448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
# File 'lib/subskribe_dev/api/revenue_recognition_api.rb', line 448

def upload_completion_events_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RevenueRecognitionApi.upload_completion_events ...'
  end
  # resource path
  local_var_path = '/revrec/events/upload'

  # 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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: RevenueRecognitionApi#upload_completion_events\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end