Class: PostBoost::SubscriptionsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/postboost/api/subscriptions_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ SubscriptionsApi



19
20
21
# File 'lib/postboost/api/subscriptions_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/postboost/api/subscriptions_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#add_generic_subscription(workspace_uuid, add_generic_subscription_request, opts = {}) ⇒ Object

Add generic subscription



27
28
29
30
# File 'lib/postboost/api/subscriptions_api.rb', line 27

def add_generic_subscription(workspace_uuid, add_generic_subscription_request, opts = {})
  data, _status_code, _headers = add_generic_subscription_with_http_info(workspace_uuid, add_generic_subscription_request, opts)
  data
end

#add_generic_subscription_with_http_info(workspace_uuid, add_generic_subscription_request, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Add generic subscription



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/postboost/api/subscriptions_api.rb', line 37

def add_generic_subscription_with_http_info(workspace_uuid, add_generic_subscription_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SubscriptionsApi.add_generic_subscription ...'
  end
  # verify the required parameter 'workspace_uuid' is set
  if @api_client.config.client_side_validation && workspace_uuid.nil?
    fail ArgumentError, "Missing the required parameter 'workspace_uuid' when calling SubscriptionsApi.add_generic_subscription"
  end
  # verify the required parameter 'add_generic_subscription_request' is set
  if @api_client.config.client_side_validation && add_generic_subscription_request.nil?
    fail ArgumentError, "Missing the required parameter 'add_generic_subscription_request' when calling SubscriptionsApi.add_generic_subscription"
  end
  # resource path
  local_var_path = '/panel/workspaces/{workspaceUuid}/subscription/generic'.sub('{' + 'workspaceUuid' + '}', CGI.escape(workspace_uuid.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(add_generic_subscription_request)

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"SubscriptionsApi.add_generic_subscription",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#add_generic_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#cancel_subscription(workspace_uuid, opts = {}) ⇒ Object

Cancel subscription



98
99
100
101
# File 'lib/postboost/api/subscriptions_api.rb', line 98

def cancel_subscription(workspace_uuid, opts = {})
  data, _status_code, _headers = cancel_subscription_with_http_info(workspace_uuid, opts)
  data
end

#cancel_subscription_with_http_info(workspace_uuid, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Cancel subscription



107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# File 'lib/postboost/api/subscriptions_api.rb', line 107

def cancel_subscription_with_http_info(workspace_uuid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SubscriptionsApi.cancel_subscription ...'
  end
  # verify the required parameter 'workspace_uuid' is set
  if @api_client.config.client_side_validation && workspace_uuid.nil?
    fail ArgumentError, "Missing the required parameter 'workspace_uuid' when calling SubscriptionsApi.cancel_subscription"
  end
  # resource path
  local_var_path = '/panel/workspaces/{workspaceUuid}/subscription/cancel'.sub('{' + 'workspaceUuid' + '}', CGI.escape(workspace_uuid.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"SubscriptionsApi.cancel_subscription",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#cancel_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#change_subscription_plan(workspace_uuid, change_subscription_plan_request, opts = {}) ⇒ Object

Change subscription plan



160
161
162
163
# File 'lib/postboost/api/subscriptions_api.rb', line 160

def change_subscription_plan(workspace_uuid, change_subscription_plan_request, opts = {})
  data, _status_code, _headers = change_subscription_plan_with_http_info(workspace_uuid, change_subscription_plan_request, opts)
  data
end

#change_subscription_plan_with_http_info(workspace_uuid, change_subscription_plan_request, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Change subscription plan



170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
# File 'lib/postboost/api/subscriptions_api.rb', line 170

def change_subscription_plan_with_http_info(workspace_uuid, change_subscription_plan_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SubscriptionsApi.change_subscription_plan ...'
  end
  # verify the required parameter 'workspace_uuid' is set
  if @api_client.config.client_side_validation && workspace_uuid.nil?
    fail ArgumentError, "Missing the required parameter 'workspace_uuid' when calling SubscriptionsApi.change_subscription_plan"
  end
  # verify the required parameter 'change_subscription_plan_request' is set
  if @api_client.config.client_side_validation && change_subscription_plan_request.nil?
    fail ArgumentError, "Missing the required parameter 'change_subscription_plan_request' when calling SubscriptionsApi.change_subscription_plan"
  end
  # resource path
  local_var_path = '/panel/workspaces/{workspaceUuid}/subscription/change-plan'.sub('{' + 'workspaceUuid' + '}', CGI.escape(workspace_uuid.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(change_subscription_plan_request)

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"SubscriptionsApi.change_subscription_plan",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#change_subscription_plan\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#checkout_subscription(workspace_uuid, checkout_subscription_request, opts = {}) ⇒ CheckoutSubscription200Response

New subscription checkout Returns a Stripe Checkout URL for a new subscription.



233
234
235
236
# File 'lib/postboost/api/subscriptions_api.rb', line 233

def checkout_subscription(workspace_uuid, checkout_subscription_request, opts = {})
  data, _status_code, _headers = checkout_subscription_with_http_info(workspace_uuid, checkout_subscription_request, opts)
  data
end

#checkout_subscription_with_http_info(workspace_uuid, checkout_subscription_request, opts = {}) ⇒ Array<(CheckoutSubscription200Response, Integer, Hash)>

New subscription checkout Returns a Stripe Checkout URL for a new subscription.



244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
# File 'lib/postboost/api/subscriptions_api.rb', line 244

def checkout_subscription_with_http_info(workspace_uuid, checkout_subscription_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SubscriptionsApi.checkout_subscription ...'
  end
  # verify the required parameter 'workspace_uuid' is set
  if @api_client.config.client_side_validation && workspace_uuid.nil?
    fail ArgumentError, "Missing the required parameter 'workspace_uuid' when calling SubscriptionsApi.checkout_subscription"
  end
  # verify the required parameter 'checkout_subscription_request' is set
  if @api_client.config.client_side_validation && checkout_subscription_request.nil?
    fail ArgumentError, "Missing the required parameter 'checkout_subscription_request' when calling SubscriptionsApi.checkout_subscription"
  end
  # resource path
  local_var_path = '/panel/workspaces/{workspaceUuid}/subscription/new'.sub('{' + 'workspaceUuid' + '}', CGI.escape(workspace_uuid.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(checkout_subscription_request)

  # return_type
  return_type = opts[:debug_return_type] || 'CheckoutSubscription200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"SubscriptionsApi.checkout_subscription",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#checkout_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_subscription(workspace_uuid, subscription_input, opts = {}) ⇒ Object

Create subscription



306
307
308
309
# File 'lib/postboost/api/subscriptions_api.rb', line 306

def create_subscription(workspace_uuid, subscription_input, opts = {})
  data, _status_code, _headers = create_subscription_with_http_info(workspace_uuid, subscription_input, opts)
  data
end

#create_subscription_with_http_info(workspace_uuid, subscription_input, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Create subscription



316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
# File 'lib/postboost/api/subscriptions_api.rb', line 316

def create_subscription_with_http_info(workspace_uuid, subscription_input, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SubscriptionsApi.create_subscription ...'
  end
  # verify the required parameter 'workspace_uuid' is set
  if @api_client.config.client_side_validation && workspace_uuid.nil?
    fail ArgumentError, "Missing the required parameter 'workspace_uuid' when calling SubscriptionsApi.create_subscription"
  end
  # verify the required parameter 'subscription_input' is set
  if @api_client.config.client_side_validation && subscription_input.nil?
    fail ArgumentError, "Missing the required parameter 'subscription_input' when calling SubscriptionsApi.create_subscription"
  end
  # resource path
  local_var_path = '/panel/workspaces/{workspaceUuid}/subscription'.sub('{' + 'workspaceUuid' + '}', CGI.escape(workspace_uuid.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(subscription_input)

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"SubscriptionsApi.create_subscription",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#create_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_subscription(workspace_uuid, opts = {}) ⇒ Object

Delete subscription



377
378
379
380
# File 'lib/postboost/api/subscriptions_api.rb', line 377

def delete_subscription(workspace_uuid, opts = {})
  data, _status_code, _headers = delete_subscription_with_http_info(workspace_uuid, opts)
  data
end

#delete_subscription_with_http_info(workspace_uuid, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Delete subscription



386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
# File 'lib/postboost/api/subscriptions_api.rb', line 386

def delete_subscription_with_http_info(workspace_uuid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SubscriptionsApi.delete_subscription ...'
  end
  # verify the required parameter 'workspace_uuid' is set
  if @api_client.config.client_side_validation && workspace_uuid.nil?
    fail ArgumentError, "Missing the required parameter 'workspace_uuid' when calling SubscriptionsApi.delete_subscription"
  end
  # resource path
  local_var_path = '/panel/workspaces/{workspaceUuid}/subscription'.sub('{' + 'workspaceUuid' + '}', CGI.escape(workspace_uuid.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"SubscriptionsApi.delete_subscription",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#delete_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_subscription(workspace_uuid, opts = {}) ⇒ Subscription

Get subscription



438
439
440
441
# File 'lib/postboost/api/subscriptions_api.rb', line 438

def get_subscription(workspace_uuid, opts = {})
  data, _status_code, _headers = get_subscription_with_http_info(workspace_uuid, opts)
  data
end

#get_subscription_with_http_info(workspace_uuid, opts = {}) ⇒ Array<(Subscription, Integer, Hash)>

Get subscription



447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
# File 'lib/postboost/api/subscriptions_api.rb', line 447

def get_subscription_with_http_info(workspace_uuid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SubscriptionsApi.get_subscription ...'
  end
  # verify the required parameter 'workspace_uuid' is set
  if @api_client.config.client_side_validation && workspace_uuid.nil?
    fail ArgumentError, "Missing the required parameter 'workspace_uuid' when calling SubscriptionsApi.get_subscription"
  end
  # resource path
  local_var_path = '/panel/workspaces/{workspaceUuid}/subscription'.sub('{' + 'workspaceUuid' + '}', CGI.escape(workspace_uuid.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Subscription'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"SubscriptionsApi.get_subscription",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#get_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#remove_generic_subscription(workspace_uuid, opts = {}) ⇒ Object

Remove generic subscription



499
500
501
502
# File 'lib/postboost/api/subscriptions_api.rb', line 499

def remove_generic_subscription(workspace_uuid, opts = {})
  data, _status_code, _headers = remove_generic_subscription_with_http_info(workspace_uuid, opts)
  data
end

#remove_generic_subscription_with_http_info(workspace_uuid, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Remove generic subscription



508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
# File 'lib/postboost/api/subscriptions_api.rb', line 508

def remove_generic_subscription_with_http_info(workspace_uuid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SubscriptionsApi.remove_generic_subscription ...'
  end
  # verify the required parameter 'workspace_uuid' is set
  if @api_client.config.client_side_validation && workspace_uuid.nil?
    fail ArgumentError, "Missing the required parameter 'workspace_uuid' when calling SubscriptionsApi.remove_generic_subscription"
  end
  # resource path
  local_var_path = '/panel/workspaces/{workspaceUuid}/subscription/generic'.sub('{' + 'workspaceUuid' + '}', CGI.escape(workspace_uuid.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"SubscriptionsApi.remove_generic_subscription",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#remove_generic_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#resume_subscription(workspace_uuid, opts = {}) ⇒ Object

Resume subscription



560
561
562
563
# File 'lib/postboost/api/subscriptions_api.rb', line 560

def resume_subscription(workspace_uuid, opts = {})
  data, _status_code, _headers = resume_subscription_with_http_info(workspace_uuid, opts)
  data
end

#resume_subscription_with_http_info(workspace_uuid, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Resume subscription



569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
# File 'lib/postboost/api/subscriptions_api.rb', line 569

def resume_subscription_with_http_info(workspace_uuid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SubscriptionsApi.resume_subscription ...'
  end
  # verify the required parameter 'workspace_uuid' is set
  if @api_client.config.client_side_validation && workspace_uuid.nil?
    fail ArgumentError, "Missing the required parameter 'workspace_uuid' when calling SubscriptionsApi.resume_subscription"
  end
  # resource path
  local_var_path = '/panel/workspaces/{workspaceUuid}/subscription/resume'.sub('{' + 'workspaceUuid' + '}', CGI.escape(workspace_uuid.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"SubscriptionsApi.resume_subscription",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#resume_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_subscription(workspace_uuid, subscription_update_input, opts = {}) ⇒ Object

Update subscription



622
623
624
625
# File 'lib/postboost/api/subscriptions_api.rb', line 622

def update_subscription(workspace_uuid, subscription_update_input, opts = {})
  data, _status_code, _headers = update_subscription_with_http_info(workspace_uuid, subscription_update_input, opts)
  data
end

#update_subscription_with_http_info(workspace_uuid, subscription_update_input, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Update subscription



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
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
# File 'lib/postboost/api/subscriptions_api.rb', line 632

def update_subscription_with_http_info(workspace_uuid, subscription_update_input, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SubscriptionsApi.update_subscription ...'
  end
  # verify the required parameter 'workspace_uuid' is set
  if @api_client.config.client_side_validation && workspace_uuid.nil?
    fail ArgumentError, "Missing the required parameter 'workspace_uuid' when calling SubscriptionsApi.update_subscription"
  end
  # verify the required parameter 'subscription_update_input' is set
  if @api_client.config.client_side_validation && subscription_update_input.nil?
    fail ArgumentError, "Missing the required parameter 'subscription_update_input' when calling SubscriptionsApi.update_subscription"
  end
  # resource path
  local_var_path = '/panel/workspaces/{workspaceUuid}/subscription'.sub('{' + 'workspaceUuid' + '}', CGI.escape(workspace_uuid.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(subscription_update_input)

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"SubscriptionsApi.update_subscription",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#update_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end