Class: SubskribeSandboxClient::ProductCatalogApi

Inherits:
Object
  • Object
show all
Defined in:
lib/subskribe_sandbox/api/product_catalog_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ProductCatalogApi

Returns a new instance of ProductCatalogApi.



19
20
21
# File 'lib/subskribe_sandbox/api/product_catalog_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_sandbox/api/product_catalog_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#activate_plan(plan_id, opts = {}) ⇒ PlanJson

Activate a plan Marks a plan as active

Parameters:

  • plan_id

    id of the plan

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

    the optional parameters

Returns:



27
28
29
30
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 27

def activate_plan(plan_id, opts = {})
  data, _status_code, _headers = activate_plan_with_http_info(plan_id, opts)
  data
end

#activate_plan_with_http_info(plan_id, opts = {}) ⇒ Array<(PlanJson, Fixnum, Hash)>

Activate a plan Marks a plan as active

Parameters:

  • plan_id

    id of the plan

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

    the optional parameters

Returns:

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

    PlanJson data, response status code and response headers



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 37

def activate_plan_with_http_info(plan_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductCatalogApi.activate_plan ...'
  end
  # verify the required parameter 'plan_id' is set
  if @api_client.config.client_side_validation && plan_id.nil?
    fail ArgumentError, "Missing the required parameter 'plan_id' when calling ProductCatalogApi.activate_plan"
  end
  # resource path
  local_var_path = '/plans/{planId}/activate'.sub('{' + 'planId' + '}', plan_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(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'PlanJson')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProductCatalogApi#activate_plan\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#add_charge(plan_id, body, opts = {}) ⇒ ChargeJson

Add charge to plan Adds a charge to the specified plan. On success the id of the new charge is returned

Parameters:

  • plan_id

    id of the plan

  • body

    json representing the charge details

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

    the optional parameters

Returns:



80
81
82
83
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 80

def add_charge(plan_id, body, opts = {})
  data, _status_code, _headers = add_charge_with_http_info(plan_id, body, opts)
  data
end

#add_charge_with_http_info(plan_id, body, opts = {}) ⇒ Array<(ChargeJson, Fixnum, Hash)>

Add charge to plan Adds a charge to the specified plan. On success the id of the new charge is returned

Parameters:

  • plan_id

    id of the plan

  • body

    json representing the charge details

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

    the optional parameters

Returns:

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

    ChargeJson data, response status code and response headers



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
126
127
128
129
130
131
132
133
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 91

def add_charge_with_http_info(plan_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductCatalogApi.add_charge ...'
  end
  # verify the required parameter 'plan_id' is set
  if @api_client.config.client_side_validation && plan_id.nil?
    fail ArgumentError, "Missing the required parameter 'plan_id' when calling ProductCatalogApi.add_charge"
  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 ProductCatalogApi.add_charge"
  end
  # resource path
  local_var_path = '/plans/{planId}/charges'.sub('{' + 'planId' + '}', plan_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(: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 => 'ChargeJson')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProductCatalogApi#add_charge\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

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

Create percent of relationship Creates a percent of relationship between a charge and plan. On success the id of the relationship is returned.

Parameters:

  • body

    json representing the relationship

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

    the optional parameters

Returns:

  • (nil)


139
140
141
142
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 139

def add_percent_of_plan_relationship(body, opts = {})
  add_percent_of_plan_relationship_with_http_info(body, opts)
  nil
end

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

Create percent of relationship Creates a percent of relationship between a charge and plan. On success the id of the relationship is returned.

Parameters:

  • body

    json representing the relationship

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 149

def add_percent_of_plan_relationship_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductCatalogApi.add_percent_of_plan_relationship ...'
  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 ProductCatalogApi.add_percent_of_plan_relationship"
  end
  # resource path
  local_var_path = '/plans/relationships/percentOf'

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

#add_plan(body, opts = {}) ⇒ PlanJson

Create a plan Creates a plan. On success the id of the new plan is returned.

Parameters:

  • body

    json of the plan details

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

    the optional parameters

Returns:



190
191
192
193
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 190

def add_plan(body, opts = {})
  data, _status_code, _headers = add_plan_with_http_info(body, opts)
  data
end

#add_plan_with_http_info(body, opts = {}) ⇒ Array<(PlanJson, Fixnum, Hash)>

Create a plan Creates a plan. On success the id of the new plan is returned.

Parameters:

  • body

    json of the plan details

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

    the optional parameters

Returns:

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

    PlanJson 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
238
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 200

def add_plan_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductCatalogApi.add_plan ...'
  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 ProductCatalogApi.add_plan"
  end
  # resource path
  local_var_path = '/plans'

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

#add_product(body, opts = {}) ⇒ ProductJson

Create a product Creates a product for your tenant. On success the id of the product is returned.

Parameters:

  • body

    product details json

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

    the optional parameters

Returns:



244
245
246
247
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 244

def add_product(body, opts = {})
  data, _status_code, _headers = add_product_with_http_info(body, opts)
  data
end

#add_product_category(body, opts = {}) ⇒ ProductCategory

Create a product category Creates a product category. On success the id of the category is returned.

Parameters:

  • body

    product category details json

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

    the optional parameters

Returns:



298
299
300
301
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 298

def add_product_category(body, opts = {})
  data, _status_code, _headers = add_product_category_with_http_info(body, opts)
  data
end

#add_product_category_with_http_info(body, opts = {}) ⇒ Array<(ProductCategory, Fixnum, Hash)>

Create a product category Creates a product category. On success the id of the category is returned.

Parameters:

  • body

    product category details json

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

    the optional parameters

Returns:

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

    ProductCategory data, response status code and response headers



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
337
338
339
340
341
342
343
344
345
346
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 308

def add_product_category_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductCatalogApi.add_product_category ...'
  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 ProductCatalogApi.add_product_category"
  end
  # resource path
  local_var_path = '/product/categories'

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

#add_product_with_http_info(body, opts = {}) ⇒ Array<(ProductJson, Fixnum, Hash)>

Create a product Creates a product for your tenant. On success the id of the product is returned.

Parameters:

  • body

    product details json

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

    the optional parameters

Returns:

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

    ProductJson data, response status code and response headers



254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 254

def add_product_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductCatalogApi.add_product ...'
  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 ProductCatalogApi.add_product"
  end
  # resource path
  local_var_path = '/products'

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

#deactivate_plan(plan_id, opts = {}) ⇒ PlanJson

Revert a plan to draft Marks a plan as draft

Parameters:

  • plan_id

    id of the plan

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

    the optional parameters

Returns:



352
353
354
355
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 352

def deactivate_plan(plan_id, opts = {})
  data, _status_code, _headers = deactivate_plan_with_http_info(plan_id, opts)
  data
end

#deactivate_plan_with_http_info(plan_id, opts = {}) ⇒ Array<(PlanJson, Fixnum, Hash)>

Revert a plan to draft Marks a plan as draft

Parameters:

  • plan_id

    id of the plan

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

    the optional parameters

Returns:

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

    PlanJson data, response status code and response headers



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
388
389
390
391
392
393
394
395
396
397
398
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 362

def deactivate_plan_with_http_info(plan_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductCatalogApi.deactivate_plan ...'
  end
  # verify the required parameter 'plan_id' is set
  if @api_client.config.client_side_validation && plan_id.nil?
    fail ArgumentError, "Missing the required parameter 'plan_id' when calling ProductCatalogApi.deactivate_plan"
  end
  # resource path
  local_var_path = '/plans/{planId}/revertToDraft'.sub('{' + 'planId' + '}', plan_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(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'PlanJson')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProductCatalogApi#deactivate_plan\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_catalog_relationship_by_id(relationship_id, opts = {}) ⇒ CatalogRelationship

Delete a catalog relationship Deletes the specified catalog relationship

Parameters:

  • relationship_id

    id of the relationship

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

    the optional parameters

Returns:



404
405
406
407
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 404

def delete_catalog_relationship_by_id(relationship_id, opts = {})
  data, _status_code, _headers = delete_catalog_relationship_by_id_with_http_info(relationship_id, opts)
  data
end

#delete_catalog_relationship_by_id_with_http_info(relationship_id, opts = {}) ⇒ Array<(CatalogRelationship, Fixnum, Hash)>

Delete a catalog relationship Deletes the specified catalog relationship

Parameters:

  • relationship_id

    id of the relationship

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

    the optional parameters

Returns:

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

    CatalogRelationship data, response status code and response headers



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
440
441
442
443
444
445
446
447
448
449
450
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 414

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

#delete_charge(plan_id, charge_id, opts = {}) ⇒ ChargeJson

Delete a charge Removes a charge from a plan.

Parameters:

  • plan_id

    id of the plan

  • charge_id

    id of the charge

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

    the optional parameters

Returns:



457
458
459
460
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 457

def delete_charge(plan_id, charge_id, opts = {})
  data, _status_code, _headers = delete_charge_with_http_info(plan_id, charge_id, opts)
  data
end

#delete_charge_with_http_info(plan_id, charge_id, opts = {}) ⇒ Array<(ChargeJson, Fixnum, Hash)>

Delete a charge Removes a charge from a plan.

Parameters:

  • plan_id

    id of the plan

  • charge_id

    id of the charge

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

    the optional parameters

Returns:

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

    ChargeJson data, response status code and response headers



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
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 468

def delete_charge_with_http_info(plan_id, charge_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductCatalogApi.delete_charge ...'
  end
  # verify the required parameter 'plan_id' is set
  if @api_client.config.client_side_validation && plan_id.nil?
    fail ArgumentError, "Missing the required parameter 'plan_id' when calling ProductCatalogApi.delete_charge"
  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 ProductCatalogApi.delete_charge"
  end
  # resource path
  local_var_path = '/plans/{planId}/charges/{chargeId}'.sub('{' + 'planId' + '}', plan_id.to_s).sub('{' + 'chargeId' + '}', charge_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(: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 => 'ChargeJson')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProductCatalogApi#delete_charge\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_plan(plan_id, opts = {}) ⇒ PlanJson

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

Parameters:

  • plan_id

    id of the plan

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

    the optional parameters

Returns:



516
517
518
519
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 516

def delete_plan(plan_id, opts = {})
  data, _status_code, _headers = delete_plan_with_http_info(plan_id, opts)
  data
end

#delete_plan_with_http_info(plan_id, opts = {}) ⇒ Array<(PlanJson, Fixnum, Hash)>

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

Parameters:

  • plan_id

    id of the plan

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

    the optional parameters

Returns:

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

    PlanJson data, response status code and response headers



526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 526

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

#delete_product(id, opts = {}) ⇒ ProductJson

Delete a product Delete the specified product.

Parameters:

  • id

    id of the product

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

    the optional parameters

Returns:



568
569
570
571
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 568

def delete_product(id, opts = {})
  data, _status_code, _headers = delete_product_with_http_info(id, opts)
  data
end

#delete_product_category(id, opts = {}) ⇒ ProductCategory

Delete a product category Deletes the specified product category. Note that a product category can’t be delete once it’s in use.

Parameters:

  • id

    id of the category

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

    the optional parameters

Returns:



620
621
622
623
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 620

def delete_product_category(id, opts = {})
  data, _status_code, _headers = delete_product_category_with_http_info(id, opts)
  data
end

#delete_product_category_with_http_info(id, opts = {}) ⇒ Array<(ProductCategory, Fixnum, Hash)>

Delete a product category Deletes the specified product category. Note that a product category can&#39;t be delete once it&#39;s in use.

Parameters:

  • id

    id of the category

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

    the optional parameters

Returns:

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

    ProductCategory data, response status code and response headers



630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 630

def delete_product_category_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductCatalogApi.delete_product_category ...'
  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 ProductCatalogApi.delete_product_category"
  end
  # resource path
  local_var_path = '/product/categories/{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(: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 => 'ProductCategory')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProductCatalogApi#delete_product_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_product_with_http_info(id, opts = {}) ⇒ Array<(ProductJson, Fixnum, Hash)>

Delete a product Delete the specified product.

Parameters:

  • id

    id of the product

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

    the optional parameters

Returns:

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

    ProductJson data, response status code and response headers



578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 578

def delete_product_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductCatalogApi.delete_product ...'
  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 ProductCatalogApi.delete_product"
  end
  # resource path
  local_var_path = '/products/{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(: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 => 'ProductJson')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProductCatalogApi#delete_product\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#deprecate_plan(plan_id, opts = {}) ⇒ PlanJson

Deprecate a plan Marks a plan as deprecated. Once deprecated a plan may not be attached to new orders.

Parameters:

  • plan_id

    id of the plan

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

    the optional parameters

Returns:



672
673
674
675
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 672

def deprecate_plan(plan_id, opts = {})
  data, _status_code, _headers = deprecate_plan_with_http_info(plan_id, opts)
  data
end

#deprecate_plan_with_http_info(plan_id, opts = {}) ⇒ Array<(PlanJson, Fixnum, Hash)>

Deprecate a plan Marks a plan as deprecated. Once deprecated a plan may not be attached to new orders.

Parameters:

  • plan_id

    id of the plan

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

    the optional parameters

Returns:

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

    PlanJson data, response status code and response headers



682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 682

def deprecate_plan_with_http_info(plan_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductCatalogApi.deprecate_plan ...'
  end
  # verify the required parameter 'plan_id' is set
  if @api_client.config.client_side_validation && plan_id.nil?
    fail ArgumentError, "Missing the required parameter 'plan_id' when calling ProductCatalogApi.deprecate_plan"
  end
  # resource path
  local_var_path = '/plans/{planId}/deprecate'.sub('{' + 'planId' + '}', plan_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(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'PlanJson')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProductCatalogApi#deprecate_plan\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#duplicate_plan(plan_id, opts = {}) ⇒ PlanJson

Duplicate a plan Duplicates the specified plan. On success the new plan id is returned.

Parameters:

  • plan_id

    id of the plan to duplicate

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

    the optional parameters

Returns:



724
725
726
727
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 724

def duplicate_plan(plan_id, opts = {})
  data, _status_code, _headers = duplicate_plan_with_http_info(plan_id, opts)
  data
end

#duplicate_plan_with_http_info(plan_id, opts = {}) ⇒ Array<(PlanJson, Fixnum, Hash)>

Duplicate a plan Duplicates the specified plan. On success the new plan id is returned.

Parameters:

  • plan_id

    id of the plan to duplicate

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

    the optional parameters

Returns:

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

    PlanJson data, response status code and response headers



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
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 734

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

#export_product_catalog(opts = {}) ⇒ nil

Export product catalog Export the product catalog in CSV format.

Parameters:

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

    the optional parameters

Returns:

  • (nil)


775
776
777
778
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 775

def export_product_catalog(opts = {})
  export_product_catalog_with_http_info(opts)
  nil
end

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

Export product catalog Export the product catalog in CSV format.

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 784

def export_product_catalog_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductCatalogApi.export_product_catalog ...'
  end
  # resource path
  local_var_path = '/products/export'

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

#get_catalog_relationship_by_id(relationship_id, opts = {}) ⇒ CatalogRelationship

Get relationship details Gets the details of the specified catalog relationship.

Parameters:

  • relationship_id

    id of the relationship

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

    the optional parameters

Returns:



821
822
823
824
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 821

def get_catalog_relationship_by_id(relationship_id, opts = {})
  data, _status_code, _headers = get_catalog_relationship_by_id_with_http_info(relationship_id, opts)
  data
end

#get_catalog_relationship_by_id_with_http_info(relationship_id, opts = {}) ⇒ Array<(CatalogRelationship, Fixnum, Hash)>

Get relationship details Gets the details of the specified catalog relationship.

Parameters:

  • relationship_id

    id of the relationship

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

    the optional parameters

Returns:

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

    CatalogRelationship data, response status code and response headers



831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 831

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

#get_charge(plan_id, charge_id, opts = {}) ⇒ ChargeJson

Get charge details Gets the details of the specified charge on the specified plan.

Parameters:

  • plan_id

    id of the plan

  • charge_id

    id of the charge

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

    the optional parameters

Returns:



874
875
876
877
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 874

def get_charge(plan_id, charge_id, opts = {})
  data, _status_code, _headers = get_charge_with_http_info(plan_id, charge_id, opts)
  data
end

#get_charge_ledger_accounts(plan_id, charge_id, opts = {}) ⇒ Array<LedgerAccount>

Get ledger accounts Gets the ledger accounts mapped to the specified charge

Parameters:

  • plan_id

    id of the plan

  • charge_id

    id of the charge

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

    the optional parameters

Returns:



932
933
934
935
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 932

def get_charge_ledger_accounts(plan_id, charge_id, opts = {})
  data, _status_code, _headers = get_charge_ledger_accounts_with_http_info(plan_id, charge_id, opts)
  data
end

#get_charge_ledger_accounts_with_http_info(plan_id, charge_id, opts = {}) ⇒ Array<(Array<LedgerAccount>, Fixnum, Hash)>

Get ledger accounts Gets the ledger accounts mapped to the specified charge

Parameters:

  • plan_id

    id of the plan

  • charge_id

    id of the charge

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

    the optional parameters

Returns:

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

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



943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 943

def get_charge_ledger_accounts_with_http_info(plan_id, charge_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductCatalogApi.get_charge_ledger_accounts ...'
  end
  # verify the required parameter 'plan_id' is set
  if @api_client.config.client_side_validation && plan_id.nil?
    fail ArgumentError, "Missing the required parameter 'plan_id' when calling ProductCatalogApi.get_charge_ledger_accounts"
  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 ProductCatalogApi.get_charge_ledger_accounts"
  end
  # resource path
  local_var_path = '/plans/{planId}/charges/{chargeId}/ledgerAccounts'.sub('{' + 'planId' + '}', plan_id.to_s).sub('{' + 'chargeId' + '}', charge_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<LedgerAccount>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProductCatalogApi#get_charge_ledger_accounts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_charge_with_http_info(plan_id, charge_id, opts = {}) ⇒ Array<(ChargeJson, Fixnum, Hash)>

Get charge details Gets the details of the specified charge on the specified plan.

Parameters:

  • plan_id

    id of the plan

  • charge_id

    id of the charge

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

    the optional parameters

Returns:

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

    ChargeJson data, response status code and response headers



885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 885

def get_charge_with_http_info(plan_id, charge_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductCatalogApi.get_charge ...'
  end
  # verify the required parameter 'plan_id' is set
  if @api_client.config.client_side_validation && plan_id.nil?
    fail ArgumentError, "Missing the required parameter 'plan_id' when calling ProductCatalogApi.get_charge"
  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 ProductCatalogApi.get_charge"
  end
  # resource path
  local_var_path = '/plans/{planId}/charges/{chargeId}'.sub('{' + 'planId' + '}', plan_id.to_s).sub('{' + 'chargeId' + '}', charge_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 => 'ChargeJson')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProductCatalogApi#get_charge\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_percent_of_relationships(from_plan_id, opts = {}) ⇒ Array<CatalogRelationship>

Get percent of relationships for a plan Gets the percent of relationships for the specified plan.

Parameters:

  • from_plan_id

    id of the plan

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

    the optional parameters

Returns:



989
990
991
992
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 989

def get_percent_of_relationships(from_plan_id, opts = {})
  data, _status_code, _headers = get_percent_of_relationships_with_http_info(from_plan_id, opts)
  data
end

#get_percent_of_relationships_with_http_info(from_plan_id, opts = {}) ⇒ Array<(Array<CatalogRelationship>, Fixnum, Hash)>

Get percent of relationships for a plan Gets the percent of relationships for the specified plan.

Parameters:

  • from_plan_id

    id of the plan

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

    the optional parameters

Returns:

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

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



999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 999

def get_percent_of_relationships_with_http_info(from_plan_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductCatalogApi.get_percent_of_relationships ...'
  end
  # verify the required parameter 'from_plan_id' is set
  if @api_client.config.client_side_validation && from_plan_id.nil?
    fail ArgumentError, "Missing the required parameter 'from_plan_id' when calling ProductCatalogApi.get_percent_of_relationships"
  end
  # resource path
  local_var_path = '/plans/relationships/percentOf'

  # query parameters
  query_params = {}
  query_params[:'fromPlanId'] = from_plan_id

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

#get_plan(plan_id, opts = {}) ⇒ PlanJson

Get plan details Returns the details of the specified plan.

Parameters:

  • plan_id

    id of the plan

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

    the optional parameters

Returns:



1042
1043
1044
1045
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 1042

def get_plan(plan_id, opts = {})
  data, _status_code, _headers = get_plan_with_http_info(plan_id, opts)
  data
end

#get_plan_with_http_info(plan_id, opts = {}) ⇒ Array<(PlanJson, Fixnum, Hash)>

Get plan details Returns the details of the specified plan.

Parameters:

  • plan_id

    id of the plan

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

    the optional parameters

Returns:

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

    PlanJson data, response status code and response headers



1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 1052

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

#get_plans(opts = {}) ⇒ PlanJsonPaginationResponse

Get plans Returns all plans for a product. The result is paginated. To retrieve all results pass the cursor returned from a call to the next call until all results are returned.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :product_id (String)

    id of the product

  • :status (String)

    filter by plan status

  • :cursor (String)

    cursor from the last call

  • :limit (Integer)

    number of results per page

Returns:



1097
1098
1099
1100
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 1097

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

#get_plans_with_http_info(opts = {}) ⇒ Array<(PlanJsonPaginationResponse, Fixnum, Hash)>

Get plans Returns all plans for a product. The result is paginated. To retrieve all results pass the cursor returned from a call to the next call until all results are returned.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :product_id (String)

    id of the product

  • :status (String)

    filter by plan status

  • :cursor (String)

    cursor from the last call

  • :limit (Integer)

    number of results per page

Returns:

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

    PlanJsonPaginationResponse data, response status code and response headers



1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 1110

def get_plans_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductCatalogApi.get_plans ...'
  end
  if @api_client.config.client_side_validation && opts[:'status'] && !['DRAFT', 'ACTIVE', 'GRANDFATHERED', 'ARCHIVED', 'DEPRECATED'].include?(opts[:'status'])
    fail ArgumentError, 'invalid value for "status", must be one of DRAFT, ACTIVE, GRANDFATHERED, ARCHIVED, DEPRECATED'
  end
  # resource path
  local_var_path = '/plans'

  # query parameters
  query_params = {}
  query_params[:'productId'] = opts[:'product_id'] if !opts[:'product_id'].nil?
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
  query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].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 => 'PlanJsonPaginationResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProductCatalogApi#get_plans\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_product(id, opts = {}) ⇒ ProductJson

Get product details. Gets the details of the specified product.

Parameters:

  • id

    id of the product

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

    the optional parameters

Returns:



1155
1156
1157
1158
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 1155

def get_product(id, opts = {})
  data, _status_code, _headers = get_product_with_http_info(id, opts)
  data
end

#get_product_categories(opts = {}) ⇒ ProductCategoryPaginationResponse

Get product Categories Gets all product categories for your tenant. The results are paginated. To fetch all results pass the cursor returned from a call to the subsequent calls until all results are returned. Initially the cursor should not be specified.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :cursor (String)

    cursor from prior call

  • :limit (Integer)

    number of results per page

Returns:



1208
1209
1210
1211
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 1208

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

#get_product_categories_with_http_info(opts = {}) ⇒ Array<(ProductCategoryPaginationResponse, Fixnum, Hash)>

Get product Categories Gets all product categories for your tenant. The results are paginated. To fetch all results pass the cursor returned from a call to the subsequent calls until all results are returned. Initially the cursor should not be specified.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :cursor (String)

    cursor from prior call

  • :limit (Integer)

    number of results per page

Returns:



1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 1219

def get_product_categories_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductCatalogApi.get_product_categories ...'
  end
  # resource path
  local_var_path = '/product/categories'

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

#get_product_category(id, opts = {}) ⇒ ProductCategory

Get product category details Gets the details of the specified product category

Parameters:

  • id

    id of the category

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

    the optional parameters

Returns:



1259
1260
1261
1262
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 1259

def get_product_category(id, opts = {})
  data, _status_code, _headers = get_product_category_with_http_info(id, opts)
  data
end

#get_product_category_with_http_info(id, opts = {}) ⇒ Array<(ProductCategory, Fixnum, Hash)>

Get product category details Gets the details of the specified product category

Parameters:

  • id

    id of the category

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

    the optional parameters

Returns:

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

    ProductCategory data, response status code and response headers



1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 1269

def get_product_category_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductCatalogApi.get_product_category ...'
  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 ProductCatalogApi.get_product_category"
  end
  # resource path
  local_var_path = '/product/categories/{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 => 'ProductCategory')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProductCatalogApi#get_product_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_product_with_http_info(id, opts = {}) ⇒ Array<(ProductJson, Fixnum, Hash)>

Get product details. Gets the details of the specified product.

Parameters:

  • id

    id of the product

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

    the optional parameters

Returns:

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

    ProductJson data, response status code and response headers



1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 1165

def get_product_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductCatalogApi.get_product ...'
  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 ProductCatalogApi.get_product"
  end
  # resource path
  local_var_path = '/products/{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 => 'ProductJson')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProductCatalogApi#get_product\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_products(opts = {}) ⇒ ProductJsonPaginationResponse

Get products Returns all products for your tenant. The results on paginated. To fetch them all pass the cursor returned from a call to the subsequent call until all results are fetched. Initially the cursor should not be specified.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :cursor (String)

    cursor received from prior call

  • :limit (Integer)

    number of results per page

Returns:



1312
1313
1314
1315
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 1312

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

#get_products_with_http_info(opts = {}) ⇒ Array<(ProductJsonPaginationResponse, Fixnum, Hash)>

Get products Returns all products for your tenant. The results on paginated. To fetch them all pass the cursor returned from a call to the subsequent call until all results are fetched. Initially the cursor should not be specified.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :cursor (String)

    cursor received from prior call

  • :limit (Integer)

    number of results per page

Returns:



1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 1323

def get_products_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductCatalogApi.get_products ...'
  end
  # resource path
  local_var_path = '/products'

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

#get_target_plans_for_percent_of_plan_id(plan_id, opts = {}) ⇒ CatalogRelationship

Get percent of target plans Gets the list of percent of charge target plans.

Parameters:

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

    the optional parameters

Returns:



1363
1364
1365
1366
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 1363

def get_target_plans_for_percent_of_plan_id(plan_id, opts = {})
  data, _status_code, _headers = get_target_plans_for_percent_of_plan_id_with_http_info(plan_id, opts)
  data
end

#get_target_plans_for_percent_of_plan_id_with_http_info(plan_id, opts = {}) ⇒ Array<(CatalogRelationship, Fixnum, Hash)>

Get percent of target plans Gets the list of percent of charge target plans.

Parameters:

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

    the optional parameters

Returns:

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

    CatalogRelationship data, response status code and response headers



1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 1373

def get_target_plans_for_percent_of_plan_id_with_http_info(plan_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductCatalogApi.get_target_plans_for_percent_of_plan_id ...'
  end
  # verify the required parameter 'plan_id' is set
  if @api_client.config.client_side_validation && plan_id.nil?
    fail ArgumentError, "Missing the required parameter 'plan_id' when calling ProductCatalogApi.get_target_plans_for_percent_of_plan_id"
  end
  # resource path
  local_var_path = '/plans/relationships/percentOf/{planId}'.sub('{' + 'planId' + '}', plan_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 => 'CatalogRelationship')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProductCatalogApi#get_target_plans_for_percent_of_plan_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#map_ledger_accounts_to_charge(plan_id, charge_id, body, opts = {}) ⇒ Array<LedgerAccount>

Map ledger accounts Map ledger accounts to the specified charge for the specified plan.

Parameters:

  • plan_id

    id of the plan

  • charge_id

    id of the charge

  • body

    list of the ledger account ids

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

    the optional parameters

Returns:



1417
1418
1419
1420
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 1417

def map_ledger_accounts_to_charge(plan_id, charge_id, body, opts = {})
  data, _status_code, _headers = map_ledger_accounts_to_charge_with_http_info(plan_id, charge_id, body, opts)
  data
end

#map_ledger_accounts_to_charge_with_http_info(plan_id, charge_id, body, opts = {}) ⇒ Array<(Array<LedgerAccount>, Fixnum, Hash)>

Map ledger accounts Map ledger accounts to the specified charge for the specified plan.

Parameters:

  • plan_id

    id of the plan

  • charge_id

    id of the charge

  • body

    list of the ledger account ids

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

    the optional parameters

Returns:

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

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



1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 1429

def map_ledger_accounts_to_charge_with_http_info(plan_id, charge_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductCatalogApi.map_ledger_accounts_to_charge ...'
  end
  # verify the required parameter 'plan_id' is set
  if @api_client.config.client_side_validation && plan_id.nil?
    fail ArgumentError, "Missing the required parameter 'plan_id' when calling ProductCatalogApi.map_ledger_accounts_to_charge"
  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 ProductCatalogApi.map_ledger_accounts_to_charge"
  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 ProductCatalogApi.map_ledger_accounts_to_charge"
  end
  # resource path
  local_var_path = '/plans/{planId}/charges/{chargeId}/ledgerAccounts'.sub('{' + 'planId' + '}', plan_id.to_s).sub('{' + 'chargeId' + '}', charge_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,
    :return_type => 'Array<LedgerAccount>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProductCatalogApi#map_ledger_accounts_to_charge\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#patch_charge(plan_id, charge_id, opts = {}) ⇒ ChargeJson

Update non-financial charge details Updates certain details of the specified charge which won’t impact its financial treatment

Parameters:

  • plan_id

    id of the plan

  • charge_id

    id of the charge

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

    the optional parameters

Options Hash (opts):

Returns:



1483
1484
1485
1486
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 1483

def patch_charge(plan_id, charge_id, opts = {})
  data, _status_code, _headers = patch_charge_with_http_info(plan_id, charge_id, opts)
  data
end

#patch_charge_with_http_info(plan_id, charge_id, opts = {}) ⇒ Array<(ChargeJson, Fixnum, Hash)>

Update non-financial charge details Updates certain details of the specified charge which won&#39;t impact its financial treatment

Parameters:

  • plan_id

    id of the plan

  • charge_id

    id of the charge

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

    the optional parameters

Options Hash (opts):

Returns:

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

    ChargeJson data, response status code and response headers



1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 1495

def patch_charge_with_http_info(plan_id, charge_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductCatalogApi.patch_charge ...'
  end
  # verify the required parameter 'plan_id' is set
  if @api_client.config.client_side_validation && plan_id.nil?
    fail ArgumentError, "Missing the required parameter 'plan_id' when calling ProductCatalogApi.patch_charge"
  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 ProductCatalogApi.patch_charge"
  end
  # resource path
  local_var_path = '/plans/{planId}/charges/{chargeId}/partial'.sub('{' + 'planId' + '}', plan_id.to_s).sub('{' + 'chargeId' + '}', charge_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(opts[:'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,
    :return_type => 'ChargeJson')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProductCatalogApi#patch_charge\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#reactivate_plan(plan_id, opts = {}) ⇒ PlanJson

Reactivate a plan Reactivates a deprecated plan.

Parameters:

  • plan_id

    id of the plan

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

    the optional parameters

Returns:



1543
1544
1545
1546
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 1543

def reactivate_plan(plan_id, opts = {})
  data, _status_code, _headers = reactivate_plan_with_http_info(plan_id, opts)
  data
end

#reactivate_plan_with_http_info(plan_id, opts = {}) ⇒ Array<(PlanJson, Fixnum, Hash)>

Reactivate a plan Reactivates a deprecated plan.

Parameters:

  • plan_id

    id of the plan

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

    the optional parameters

Returns:

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

    PlanJson data, response status code and response headers



1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 1553

def reactivate_plan_with_http_info(plan_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductCatalogApi.reactivate_plan ...'
  end
  # verify the required parameter 'plan_id' is set
  if @api_client.config.client_side_validation && plan_id.nil?
    fail ArgumentError, "Missing the required parameter 'plan_id' when calling ProductCatalogApi.reactivate_plan"
  end
  # resource path
  local_var_path = '/plans/{planId}/reactivate'.sub('{' + 'planId' + '}', plan_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(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'PlanJson')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProductCatalogApi#reactivate_plan\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_charge(plan_id, charge_id, opts = {}) ⇒ nil

Update charge details Updates the details of the specified charge on the specified plan.

Parameters:

  • plan_id

    id of the plan associated with the charge

  • charge_id

    id of the charge

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

    the optional parameters

Options Hash (opts):

Returns:

  • (nil)


1597
1598
1599
1600
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 1597

def update_charge(plan_id, charge_id, opts = {})
  update_charge_with_http_info(plan_id, charge_id, opts)
  nil
end

#update_charge_with_http_info(plan_id, charge_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Update charge details Updates the details of the specified charge on the specified plan.

Parameters:

  • plan_id

    id of the plan associated with the charge

  • charge_id

    id of the charge

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

    the optional parameters

Options Hash (opts):

Returns:

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

    nil, response status code and response headers



1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 1609

def update_charge_with_http_info(plan_id, charge_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductCatalogApi.update_charge ...'
  end
  # verify the required parameter 'plan_id' is set
  if @api_client.config.client_side_validation && plan_id.nil?
    fail ArgumentError, "Missing the required parameter 'plan_id' when calling ProductCatalogApi.update_charge"
  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 ProductCatalogApi.update_charge"
  end
  # resource path
  local_var_path = '/plans/{planId}/charges/{chargeId}'.sub('{' + 'planId' + '}', plan_id.to_s).sub('{' + 'chargeId' + '}', charge_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(opts[:'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: ProductCatalogApi#update_charge\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_plan(plan_id, body, opts = {}) ⇒ PlanJson

Update plan Updates the details of the specified plan. Note you can’t update the details of a plan once it’s in use.

Parameters:

  • plan_id

    id of the plan

  • body

    json of the plan details

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

    the optional parameters

Returns:



1657
1658
1659
1660
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 1657

def update_plan(plan_id, body, opts = {})
  data, _status_code, _headers = update_plan_with_http_info(plan_id, body, opts)
  data
end

#update_plan_metadata(plan_id, body, opts = {}) ⇒ PlanJson

Update plan metadata Update plan metadata. For now, this can be used only to change the entities assigned to a plan

Parameters:

  • plan_id

    plan id

  • body

    plan metadata to be updated

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

    the optional parameters

Returns:



1715
1716
1717
1718
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 1715

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

#update_plan_metadata_with_http_info(plan_id, body, opts = {}) ⇒ Array<(PlanJson, Fixnum, Hash)>

Update plan metadata Update plan metadata. For now, this can be used only to change the entities assigned to a plan

Parameters:

  • plan_id

    plan id

  • body

    plan metadata to be updated

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

    the optional parameters

Returns:

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

    PlanJson data, response status code and response headers



1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 1726

def (plan_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductCatalogApi.update_plan_metadata ...'
  end
  # verify the required parameter 'plan_id' is set
  if @api_client.config.client_side_validation && plan_id.nil?
    fail ArgumentError, "Missing the required parameter 'plan_id' when calling ProductCatalogApi.update_plan_metadata"
  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 ProductCatalogApi.update_plan_metadata"
  end
  # resource path
  local_var_path = '/plans/{planId}/metadata'.sub('{' + 'planId' + '}', plan_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 = @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,
    :return_type => 'PlanJson')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProductCatalogApi#update_plan_metadata\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_plan_with_http_info(plan_id, body, opts = {}) ⇒ Array<(PlanJson, Fixnum, Hash)>

Update plan Updates the details of the specified plan. Note you can&#39;t update the details of a plan once it&#39;s in use.

Parameters:

  • plan_id

    id of the plan

  • body

    json of the plan details

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

    the optional parameters

Returns:

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

    PlanJson data, response status code and response headers



1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 1668

def update_plan_with_http_info(plan_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProductCatalogApi.update_plan ...'
  end
  # verify the required parameter 'plan_id' is set
  if @api_client.config.client_side_validation && plan_id.nil?
    fail ArgumentError, "Missing the required parameter 'plan_id' when calling ProductCatalogApi.update_plan"
  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 ProductCatalogApi.update_plan"
  end
  # resource path
  local_var_path = '/plans/{planId}'.sub('{' + 'planId' + '}', plan_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 = @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,
    :return_type => 'PlanJson')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProductCatalogApi#update_plan\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

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

Update product details Updates the details of the specified product

Parameters:

  • id

    id of the product

  • body

    product details json

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

    the optional parameters

Returns:

  • (nil)


1773
1774
1775
1776
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 1773

def update_product(id, body, opts = {})
  update_product_with_http_info(id, body, opts)
  nil
end

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

Update product category details Updates the details of a product category

Parameters:

  • id

    id of the category

  • body

    product category details json

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

    the optional parameters

Returns:

  • (nil)


1832
1833
1834
1835
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 1832

def update_product_category(id, body, opts = {})
  update_product_category_with_http_info(id, body, opts)
  nil
end

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

Update product category details Updates the details of a product category

Parameters:

  • id

    id of the category

  • body

    product category details json

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 1843

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

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

Update product details Updates the details of the specified product

Parameters:

  • id

    id of the product

  • body

    product details json

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
# File 'lib/subskribe_sandbox/api/product_catalog_api.rb', line 1784

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