Class: SubskribeDevClient::SubscriptionsApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ SubscriptionsApi

Returns a new instance of SubscriptionsApi.



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

def api_client
  @api_client
end

Instance Method Details

#delete_subscription(id, version, opts = {}) ⇒ nil

Delete subscription Deletes the subscription for given subscription Id if invoices have not been generated and revenue has not been recognized

Parameters:

  • id

    subscription id

  • version

    subscription version

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

    the optional parameters

Returns:

  • (nil)


28
29
30
31
# File 'lib/subskribe_dev/api/subscriptions_api.rb', line 28

def delete_subscription(id, version, opts = {})
  delete_subscription_with_http_info(id, version, opts)
  nil
end

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

Delete subscription Deletes the subscription for given subscription Id if invoices have not been generated and revenue has not been recognized

Parameters:

  • id

    subscription id

  • version

    subscription version

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
77
78
# File 'lib/subskribe_dev/api/subscriptions_api.rb', line 39

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

#get_subscription_billing_periods(id, opts = {}) ⇒ Array<Integer>

Get billing periods Gets the billing periods for the specified subscription.

Parameters:

  • id

    subscription id

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

    the optional parameters

Returns:

  • (Array<Integer>)


84
85
86
87
# File 'lib/subskribe_dev/api/subscriptions_api.rb', line 84

def get_subscription_billing_periods(id, opts = {})
  data, _status_code, _headers = get_subscription_billing_periods_with_http_info(id, opts)
  data
end

#get_subscription_billing_periods_with_http_info(id, opts = {}) ⇒ Array<(Array<Integer>, Fixnum, Hash)>

Get billing periods Gets the billing periods for the specified subscription.

Parameters:

  • id

    subscription id

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

    the optional parameters

Returns:

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

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



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
126
127
128
129
130
# File 'lib/subskribe_dev/api/subscriptions_api.rb', line 94

def get_subscription_billing_periods_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SubscriptionsApi.get_subscription_billing_periods ...'
  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 SubscriptionsApi.get_subscription_billing_periods"
  end
  # resource path
  local_var_path = '/subscriptions/{id}/billingPeriods'.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,
    :return_type => 'Array<Integer>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#get_subscription_billing_periods\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_subscription_by_id(id, opts = {}) ⇒ SubscriptionJson

Get subscription details Gets the details of the specified subscription.

Parameters:

  • id

    subscription id

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

    the optional parameters

Returns:



136
137
138
139
# File 'lib/subskribe_dev/api/subscriptions_api.rb', line 136

def get_subscription_by_id(id, opts = {})
  data, _status_code, _headers = get_subscription_by_id_with_http_info(id, opts)
  data
end

#get_subscription_by_id_with_http_info(id, opts = {}) ⇒ Array<(SubscriptionJson, Fixnum, Hash)>

Get subscription details Gets the details of the specified subscription.

Parameters:

  • id

    subscription id

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

    the optional parameters

Returns:

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

    SubscriptionJson data, response status code and response headers



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

def get_subscription_by_id_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SubscriptionsApi.get_subscription_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 SubscriptionsApi.get_subscription_by_id"
  end
  # resource path
  local_var_path = '/subscriptions/{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,
    :return_type => 'SubscriptionJson')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#get_subscription_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_subscription_metrics(id, opts = {}) ⇒ MetricsJson

Get subscription metrics Returns the metrics associated with the specified subscription. Metrics include ACV, ARR, etc.

Parameters:

  • id

    id of the subscription

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

    the optional parameters

Options Hash (opts):

  • :target_date (Integer)

    As of date for the metrics. If omitted defaults to now.

Returns:



189
190
191
192
# File 'lib/subskribe_dev/api/subscriptions_api.rb', line 189

def get_subscription_metrics(id, opts = {})
  data, _status_code, _headers = get_subscription_metrics_with_http_info(id, opts)
  data
end

#get_subscription_metrics_with_http_info(id, opts = {}) ⇒ Array<(MetricsJson, Fixnum, Hash)>

Get subscription metrics Returns the metrics associated with the specified subscription. Metrics include ACV, ARR, etc.

Parameters:

  • id

    id of the subscription

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

    the optional parameters

Options Hash (opts):

  • :target_date (Integer)

    As of date for the metrics. If omitted defaults to now.

Returns:

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

    MetricsJson data, response status code and response headers



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

def get_subscription_metrics_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SubscriptionsApi.get_subscription_metrics ...'
  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 SubscriptionsApi.get_subscription_metrics"
  end
  # resource path
  local_var_path = '/subscriptions/{id}/metrics'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}
  query_params[:'targetDate'] = opts[:'target_date'] if !opts[:'target_date'].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 => 'MetricsJson')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#get_subscription_metrics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_subscriptions(opts = {}) ⇒ PaginatedResponse

Get paginated subscriptions returns all Subscriptions in the system in a paginated fashion

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    number of items per page

  • :page_token (String)

    pass this to subsequent calls

  • :account_id (String)

    optionally pass in account Id, only subscriptions for this account will will returned

Returns:



245
246
247
248
# File 'lib/subskribe_dev/api/subscriptions_api.rb', line 245

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

#get_subscriptions_with_http_info(opts = {}) ⇒ Array<(PaginatedResponse, Fixnum, Hash)>

Get paginated subscriptions returns all Subscriptions in the system in a paginated fashion

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    number of items per page

  • :page_token (String)

    pass this to subsequent calls

  • :account_id (String)

    optionally pass in account Id, only subscriptions for this account will will returned

Returns:

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

    PaginatedResponse data, response status code and response headers



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

def get_subscriptions_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SubscriptionsApi.get_subscriptions ...'
  end
  # resource path
  local_var_path = '/subscriptions'

  # query parameters
  query_params = {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'pageToken'] = opts[:'page_token'] if !opts[:'page_token'].nil?
  query_params[:'accountId'] = opts[:'account_id'] if !opts[:'account_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 => 'PaginatedResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#get_subscriptions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#revert_subscription(id, version, opts = {}) ⇒ nil

Revert subscription Reverts the subscription for given subscription Id and version to it’s previous version. Operation is allowed only if invoices have not been generated and revenue has not been recognized

Parameters:

  • id

    subscription id

  • version

    subscription version

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

    the optional parameters

Returns:

  • (nil)


299
300
301
302
# File 'lib/subskribe_dev/api/subscriptions_api.rb', line 299

def revert_subscription(id, version, opts = {})
  revert_subscription_with_http_info(id, version, opts)
  nil
end

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

Revert subscription Reverts the subscription for given subscription Id and version to it&#39;s previous version. Operation is allowed only if invoices have not been generated and revenue has not been recognized

Parameters:

  • id

    subscription id

  • version

    subscription version

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
337
338
339
340
341
342
343
344
345
346
347
348
349
# File 'lib/subskribe_dev/api/subscriptions_api.rb', line 310

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

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

Subscription can be modified Returns true if subscription can be deleted.

Parameters:

  • id

    subscription id

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

    the optional parameters

Returns:

  • (nil)


355
356
357
358
# File 'lib/subskribe_dev/api/subscriptions_api.rb', line 355

def subscription_modifiable(id, opts = {})
  subscription_modifiable_with_http_info(id, opts)
  nil
end

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

Subscription can be modified Returns true if subscription can be deleted.

Parameters:

  • id

    subscription id

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



365
366
367
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
# File 'lib/subskribe_dev/api/subscriptions_api.rb', line 365

def subscription_modifiable_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SubscriptionsApi.subscription_modifiable ...'
  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 SubscriptionsApi.subscription_modifiable"
  end
  # resource path
  local_var_path = '/subscriptions/{id}/modifiable'.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'])
  # 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 = 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: SubscriptionsApi#subscription_modifiable\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

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

Subscription can be reverted Returns true if subscription can be reverted to a prior version.

Parameters:

  • id

    subscription id

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

    the optional parameters

Returns:

  • (nil)


408
409
410
411
# File 'lib/subskribe_dev/api/subscriptions_api.rb', line 408

def subscription_reversible(id, opts = {})
  subscription_reversible_with_http_info(id, opts)
  nil
end

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

Subscription can be reverted Returns true if subscription can be reverted to a prior version.

Parameters:

  • id

    subscription id

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



418
419
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/subscriptions_api.rb', line 418

def subscription_reversible_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SubscriptionsApi.subscription_reversible ...'
  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 SubscriptionsApi.subscription_reversible"
  end
  # resource path
  local_var_path = '/subscriptions/{id}/reversible'.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'])
  # 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 = 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: SubscriptionsApi#subscription_reversible\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_renewal_opportunity(id, renewal_opportunity_crm_id, opts = {}) ⇒ nil

Link renewal opportunity to subscription Update renewal opportunity CRM id on subscription

Parameters:

  • id

    subscription id

  • renewal_opportunity_crm_id

    renewal opportunity CRM id

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

    the optional parameters

Returns:

  • (nil)


462
463
464
465
# File 'lib/subskribe_dev/api/subscriptions_api.rb', line 462

def update_renewal_opportunity(id, renewal_opportunity_crm_id, opts = {})
  update_renewal_opportunity_with_http_info(id, renewal_opportunity_crm_id, opts)
  nil
end

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

Link renewal opportunity to subscription Update renewal opportunity CRM id on subscription

Parameters:

  • id

    subscription id

  • renewal_opportunity_crm_id

    renewal opportunity CRM id

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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

def update_renewal_opportunity_with_http_info(id, renewal_opportunity_crm_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SubscriptionsApi.update_renewal_opportunity ...'
  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 SubscriptionsApi.update_renewal_opportunity"
  end
  # verify the required parameter 'renewal_opportunity_crm_id' is set
  if @api_client.config.client_side_validation && renewal_opportunity_crm_id.nil?
    fail ArgumentError, "Missing the required parameter 'renewal_opportunity_crm_id' when calling SubscriptionsApi.update_renewal_opportunity"
  end
  # resource path
  local_var_path = '/subscriptions/{id}/renewalOpportunity'.sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}
  query_params[:'renewalOpportunityCrmId'] = renewal_opportunity_crm_id

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

#update_subscription(id, body, opts = {}) ⇒ nil

Update subscription details Updates the details of the specified subscription.

Parameters:

  • id

    subscription id

  • body

    subscription details in json

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

    the optional parameters

Returns:

  • (nil)


522
523
524
525
# File 'lib/subskribe_dev/api/subscriptions_api.rb', line 522

def update_subscription(id, body, opts = {})
  update_subscription_with_http_info(id, body, opts)
  nil
end

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

Update subscription details Updates the details of the specified subscription.

Parameters:

  • id

    subscription id

  • body

    subscription details in json

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
572
573
574
# File 'lib/subskribe_dev/api/subscriptions_api.rb', line 533

def update_subscription_with_http_info(id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SubscriptionsApi.update_subscription ...'
  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 SubscriptionsApi.update_subscription"
  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 SubscriptionsApi.update_subscription"
  end
  # resource path
  local_var_path = '/subscriptions/{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'])
  # 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(: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: SubscriptionsApi#update_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end