Class: Bfwd::SubscriptionsApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ SubscriptionsApi

Returns a new instance of SubscriptionsApi.



30
31
32
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 30

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



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

def api_client
  @api_client
end

Instance Method Details

#add_charge_to_subscription(subscription_id, charge, opts = {}) ⇒ SubscriptionChargePagedMetadata

Creates a charge on the specified subscription. Charge","response":"addChargeToSubscriptionRequest.html","response":"addChargeToSubscription.html"

Parameters:

  • subscription_id

    ID of the subscription.

  • charge

    The charge request

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

    the optional parameters

Returns:



40
41
42
43
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 40

def add_charge_to_subscription(subscription_id, charge, opts = {})
  data, _status_code, _headers = add_charge_to_subscription_with_http_info(subscription_id, charge, opts)
  return data
end

#add_charge_to_subscription_with_http_info(subscription_id, charge, opts = {}) ⇒ Array<(SubscriptionChargePagedMetadata, Fixnum, Hash)>

Creates a charge on the specified subscription. Charge&quot;,&quot;response&quot;:&quot;addChargeToSubscriptionRequest.html&quot;,&quot;response&quot;:&quot;addChargeToSubscription.html&quot;

Parameters:

  • subscription_id

    ID of the subscription.

  • charge

    The charge request

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

    the optional parameters

Returns:



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
93
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 51

def add_charge_to_subscription_with_http_info(subscription_id, charge, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SubscriptionsApi.add_charge_to_subscription ..."
  end
  # verify the required parameter 'subscription_id' is set
  fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.add_charge_to_subscription" if subscription_id.nil?
  # verify the required parameter 'charge' is set
  fail ArgumentError, "Missing the required parameter 'charge' when calling SubscriptionsApi.add_charge_to_subscription" if charge.nil?
  # resource path
  local_var_path = "/subscriptions/{subscription-ID}/charge".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(charge)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SubscriptionChargePagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#add_charge_to_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#add_coupon_to_subscription(subscription_id, request, opts = {}) ⇒ CouponPagedMetadata

Applies a coupon to a subscription. coupon", "request":"addCouponCodeRequest.html","response":"addCouponCodeResponse.html"

Parameters:

  • subscription_id
  • request

    Request containing the coupon code.

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

    the optional parameters

Returns:



101
102
103
104
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 101

def add_coupon_to_subscription(subscription_id, request, opts = {})
  data, _status_code, _headers = add_coupon_to_subscription_with_http_info(subscription_id, request, opts)
  return data
end

#add_coupon_to_subscription_with_http_info(subscription_id, request, opts = {}) ⇒ Array<(CouponPagedMetadata, Fixnum, Hash)>

Applies a coupon to a subscription. coupon&quot;, &quot;request&quot;:&quot;addCouponCodeRequest.html&quot;,&quot;response&quot;:&quot;addCouponCodeResponse.html&quot;

Parameters:

  • subscription_id
  • request

    Request containing the coupon code.

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

    the optional parameters

Returns:

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

    CouponPagedMetadata data, response status code and response headers



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
154
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 112

def add_coupon_to_subscription_with_http_info(subscription_id, request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SubscriptionsApi.add_coupon_to_subscription ..."
  end
  # verify the required parameter 'subscription_id' is set
  fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.add_coupon_to_subscription" if subscription_id.nil?
  # verify the required parameter 'request' is set
  fail ArgumentError, "Missing the required parameter 'request' when calling SubscriptionsApi.add_coupon_to_subscription" if request.nil?
  # resource path
  local_var_path = "/subscriptions/{subscription-ID}/coupons".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(request)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CouponPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#add_coupon_to_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#add_credit_note_to_subscription(subscription_id, credit_note, opts = {}) ⇒ CreditNotePagedMetadata

Creates a credit-note which may be used by only the specified subscription. Credit","request":"addCreditNoteToSubscriptionRequest.html", "response":"addCreditNoteToSubscription.html"

Parameters:

  • subscription_id

    ID of the subscription.

  • credit_note

    The credit-note request

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

    the optional parameters

Returns:



162
163
164
165
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 162

def add_credit_note_to_subscription(subscription_id, credit_note, opts = {})
  data, _status_code, _headers = add_credit_note_to_subscription_with_http_info(subscription_id, credit_note, opts)
  return data
end

#add_credit_note_to_subscription_with_http_info(subscription_id, credit_note, opts = {}) ⇒ Array<(CreditNotePagedMetadata, Fixnum, Hash)>

Creates a credit-note which may be used by only the specified subscription. Credit&quot;,&quot;request&quot;:&quot;addCreditNoteToSubscriptionRequest.html&quot;, &quot;response&quot;:&quot;addCreditNoteToSubscription.html&quot;

Parameters:

  • subscription_id

    ID of the subscription.

  • credit_note

    The credit-note request

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

    the optional parameters

Returns:

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

    CreditNotePagedMetadata data, response status code and response headers



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

def add_credit_note_to_subscription_with_http_info(subscription_id, credit_note, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SubscriptionsApi.add_credit_note_to_subscription ..."
  end
  # verify the required parameter 'subscription_id' is set
  fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.add_credit_note_to_subscription" if subscription_id.nil?
  # verify the required parameter 'credit_note' is set
  fail ArgumentError, "Missing the required parameter 'credit_note' when calling SubscriptionsApi.add_credit_note_to_subscription" if credit_note.nil?
  # resource path
  local_var_path = "/subscriptions/{subscription-ID}/credit".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(credit_note)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CreditNotePagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#add_credit_note_to_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#add_payment_method_to_subscription(subscription_id, payment_method, opts = {}) ⇒ PaymentMethodPagedMetadata

Enables the payment method to pay invoices of this subscription. payment-method to subscription","response":"addPaymentMethod.html","request":"addPaymentMethod.request.html"

Parameters:

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

    the optional parameters

Returns:



223
224
225
226
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 223

def add_payment_method_to_subscription(subscription_id, payment_method, opts = {})
  data, _status_code, _headers = add_payment_method_to_subscription_with_http_info(subscription_id, payment_method, opts)
  return data
end

#add_payment_method_to_subscription_with_http_info(subscription_id, payment_method, opts = {}) ⇒ Array<(PaymentMethodPagedMetadata, Fixnum, Hash)>

Enables the payment method to pay invoices of this subscription. payment-method to subscription&quot;,&quot;response&quot;:&quot;addPaymentMethod.html&quot;,&quot;request&quot;:&quot;addPaymentMethod.request.html&quot;

Parameters:

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

    the optional parameters

Returns:

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

    PaymentMethodPagedMetadata data, response status code and response headers



234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 234

def add_payment_method_to_subscription_with_http_info(subscription_id, payment_method, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SubscriptionsApi.add_payment_method_to_subscription ..."
  end
  # verify the required parameter 'subscription_id' is set
  fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.add_payment_method_to_subscription" if subscription_id.nil?
  # verify the required parameter 'payment_method' is set
  fail ArgumentError, "Missing the required parameter 'payment_method' when calling SubscriptionsApi.add_payment_method_to_subscription" if payment_method.nil?
  # resource path
  local_var_path = "/subscriptions/{subscription-ID}/payment-methods".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(payment_method)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'PaymentMethodPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#add_payment_method_to_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#advance_subscription(subscription_id, request, opts = {}) ⇒ TimeResponsePagedMetadata

Advance the subscription through time. Bfwd::SubscriptionsApi."nickname":"Advance","request":"advanceSubscriptionRequest.html","response":"advanceSubscription"nickname":"Advance","request":"advanceSubscriptionRequest.html","response":"advanceSubscription.html"

Parameters:

  • subscription_id

    ID of the subscription.

  • request

    The request

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

    the optional parameters

Returns:



284
285
286
287
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 284

def advance_subscription(subscription_id, request, opts = {})
  data, _status_code, _headers = advance_subscription_with_http_info(subscription_id, request, opts)
  return data
end

#advance_subscription_with_http_info(subscription_id, request, opts = {}) ⇒ Array<(TimeResponsePagedMetadata, Fixnum, Hash)>

Advance the subscription through time. Bfwd::SubscriptionsApi.&quot;nickname&quot;:&quot;Advance&quot;,&quot;request&quot;:&quot;advanceSubscriptionRequest.html&quot;,&quot;response&quot;:&quot;advanceSubscription&quot;nickname&quot;:&quot;Advance&quot;,&quot;request&quot;:&quot;advanceSubscriptionRequest.html&quot;,&quot;response&quot;:&quot;advanceSubscription.html&quot;

Parameters:

  • subscription_id

    ID of the subscription.

  • request

    The request

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

    the optional parameters

Returns:

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

    TimeResponsePagedMetadata data, response status code and response headers



295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 295

def advance_subscription_with_http_info(subscription_id, request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SubscriptionsApi.advance_subscription ..."
  end
  # verify the required parameter 'subscription_id' is set
  fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.advance_subscription" if subscription_id.nil?
  # verify the required parameter 'request' is set
  fail ArgumentError, "Missing the required parameter 'request' when calling SubscriptionsApi.advance_subscription" if request.nil?
  # resource path
  local_var_path = "/subscriptions/{subscription-ID}/advance".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(request)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'TimeResponsePagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#advance_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#available_payment_methods_for_subscription(subscription_id, opts = {}) ⇒ PaymentMethodPagedMetadata

Returns all available payment methods for the specified subscription. By default 10 values are returned. Records are returned in natural order. { "nickname" : "List on subscription","response" : "getAvailablePaymentMethods.html"}

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

  • :offset (Integer)

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

  • :records (Integer)

    The maximum number of subscriptions to return. (default to 10)

  • :order_by (String)

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

  • :order (String)

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

Returns:



349
350
351
352
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 349

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

#available_payment_methods_for_subscription_with_http_info(subscription_id, opts = {}) ⇒ Array<(PaymentMethodPagedMetadata, Fixnum, Hash)>

Returns all available payment methods for the specified subscription. By default 10 values are returned. Records are returned in natural order. { &quot;nickname&quot; : &quot;List on subscription&quot;,&quot;response&quot; : &quot;getAvailablePaymentMethods.html&quot;}

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

  • :offset (Integer)

    The offset from the first subscription to return.

  • :records (Integer)

    The maximum number of subscriptions to return.

  • :order_by (String)

    Specify a field used to order the result set.

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC.

Returns:

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

    PaymentMethodPagedMetadata data, response status code and response headers



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
399
400
401
402
403
404
405
406
407
408
409
410
411
412
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 364

def available_payment_methods_for_subscription_with_http_info(subscription_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SubscriptionsApi.available_payment_methods_for_subscription ..."
  end
  # verify the required parameter 'subscription_id' is set
  fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.available_payment_methods_for_subscription" if subscription_id.nil?
  if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = "/subscriptions/{subscription-ID}/payment-methods".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)

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

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'PaymentMethodPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#available_payment_methods_for_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#batch_create_subscriptions(request, opts = {}) ⇒ SubscriptionPagedMetadata

Create multiple subscriptions. multiple subscriptions","response":"createMultipleSubscriptionViaHelper.html","request":"createMultipleSubscriptionViaHelper.request.html"

Parameters:

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

    the optional parameters

Returns:



419
420
421
422
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 419

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

#batch_create_subscriptions_with_http_info(request, opts = {}) ⇒ Array<(SubscriptionPagedMetadata, Fixnum, Hash)>

Create multiple subscriptions. multiple subscriptions&quot;,&quot;response&quot;:&quot;createMultipleSubscriptionViaHelper.html&quot;,&quot;request&quot;:&quot;createMultipleSubscriptionViaHelper.request.html&quot;

Parameters:

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

    the optional parameters

Returns:

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

    SubscriptionPagedMetadata data, response status code and response headers



429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 429

def batch_create_subscriptions_with_http_info(request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SubscriptionsApi.batch_create_subscriptions ..."
  end
  # verify the required parameter 'request' is set
  fail ArgumentError, "Missing the required parameter 'request' when calling SubscriptionsApi.batch_create_subscriptions" if request.nil?
  # resource path
  local_var_path = "/subscriptions/batch".sub('{format}','json')

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(request)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SubscriptionPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#batch_create_subscriptions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#cancel_subscription(subscription_id, subscription_cancellation, opts = {}) ⇒ SubscriptionCancellationPagedMetadata

Retires the subscription specified by the subscription-ID parameter. Retiring a subscription causes it to cancel based on the specified retirement settings for the product. subscription","response":"deleteSubscription.html","request":"deleteSubscriptionRequest.html"

Parameters:

  • subscription_id
  • subscription_cancellation

    The cancellation request

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

    the optional parameters

Returns:



477
478
479
480
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 477

def cancel_subscription(subscription_id, subscription_cancellation, opts = {})
  data, _status_code, _headers = cancel_subscription_with_http_info(subscription_id, subscription_cancellation, opts)
  return data
end

#cancel_subscription_with_http_info(subscription_id, subscription_cancellation, opts = {}) ⇒ Array<(SubscriptionCancellationPagedMetadata, Fixnum, Hash)>

Retires the subscription specified by the subscription-ID parameter. Retiring a subscription causes it to cancel based on the specified retirement settings for the product. subscription&quot;,&quot;response&quot;:&quot;deleteSubscription.html&quot;,&quot;request&quot;:&quot;deleteSubscriptionRequest.html&quot;

Parameters:

  • subscription_id
  • subscription_cancellation

    The cancellation request

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

    the optional parameters

Returns:



488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 488

def cancel_subscription_with_http_info(subscription_id, subscription_cancellation, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SubscriptionsApi.cancel_subscription ..."
  end
  # verify the required parameter 'subscription_id' is set
  fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.cancel_subscription" if subscription_id.nil?
  # verify the required parameter 'subscription_cancellation' is set
  fail ArgumentError, "Missing the required parameter 'subscription_cancellation' when calling SubscriptionsApi.cancel_subscription" if subscription_cancellation.nil?
  # resource path
  local_var_path = "/subscriptions/{subscription-ID}/cancel".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(subscription_cancellation)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SubscriptionCancellationPagedMetadata')
  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

#create_aggregating_subscription(request, opts = {}) ⇒ SubscriptionPagedMetadata

Create an aggregating subscription. aggregating subscription","response":"createAggregatingSubscription.html","request":"createAggregatingSubscription.request.html"

Parameters:

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

    the optional parameters

Returns:



537
538
539
540
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 537

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

#create_aggregating_subscription_with_http_info(request, opts = {}) ⇒ Array<(SubscriptionPagedMetadata, Fixnum, Hash)>

Create an aggregating subscription. aggregating subscription&quot;,&quot;response&quot;:&quot;createAggregatingSubscription.html&quot;,&quot;request&quot;:&quot;createAggregatingSubscription.request.html&quot;

Parameters:

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

    the optional parameters

Returns:

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

    SubscriptionPagedMetadata data, response status code and response headers



547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 547

def create_aggregating_subscription_with_http_info(request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SubscriptionsApi.create_aggregating_subscription ..."
  end
  # verify the required parameter 'request' is set
  fail ArgumentError, "Missing the required parameter 'request' when calling SubscriptionsApi.create_aggregating_subscription" if request.nil?
  # resource path
  local_var_path = "/subscriptions/aggregating".sub('{format}','json')

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(request)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SubscriptionPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#create_aggregating_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_subscription(subscription, opts = {}) ⇒ SubscriptionPagedMetadata

Create a new subscription. a new subscription","request":"createSubscriptionRequest.html","response":"createSubscriptionResponse.html"

Parameters:

  • subscription

    The subscription object to be updated.

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

    the optional parameters

Returns:



594
595
596
597
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 594

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

#create_subscription_v2(request, opts = {}) ⇒ SubscriptionPagedMetadata

Create a subscription (V2). a subscription (V2)","response":"createSubscriptionViaHelper.html","request":"createSubscriptionViaHelper.request.html"

Parameters:

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

    the optional parameters

Returns:



651
652
653
654
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 651

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

#create_subscription_v2_with_http_info(request, opts = {}) ⇒ Array<(SubscriptionPagedMetadata, Fixnum, Hash)>

Create a subscription (V2). a subscription (V2)&quot;,&quot;response&quot;:&quot;createSubscriptionViaHelper.html&quot;,&quot;request&quot;:&quot;createSubscriptionViaHelper.request.html&quot;

Parameters:

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

    the optional parameters

Returns:

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

    SubscriptionPagedMetadata data, response status code and response headers



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

def create_subscription_v2_with_http_info(request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SubscriptionsApi.create_subscription_v2 ..."
  end
  # verify the required parameter 'request' is set
  fail ArgumentError, "Missing the required parameter 'request' when calling SubscriptionsApi.create_subscription_v2" if request.nil?
  # resource path
  local_var_path = "/subscriptions/create".sub('{format}','json')

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(request)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SubscriptionPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#create_subscription_v2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_subscription_with_http_info(subscription, opts = {}) ⇒ Array<(SubscriptionPagedMetadata, Fixnum, Hash)>

Create a new subscription. a new subscription&quot;,&quot;request&quot;:&quot;createSubscriptionRequest.html&quot;,&quot;response&quot;:&quot;createSubscriptionResponse.html&quot;

Parameters:

  • subscription

    The subscription object to be updated.

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

    the optional parameters

Returns:

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

    SubscriptionPagedMetadata data, response status code and response headers



604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 604

def create_subscription_with_http_info(subscription, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SubscriptionsApi.create_subscription ..."
  end
  # verify the required parameter 'subscription' is set
  fail ArgumentError, "Missing the required parameter 'subscription' when calling SubscriptionsApi.create_subscription" if subscription.nil?
  # resource path
  local_var_path = "/subscriptions".sub('{format}','json')

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['text/xml', 'application/xml', 'application/json; charset=utf-8']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(subscription)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SubscriptionPagedMetadata')
  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

#create_timer(subscription_id, request, opts = {}) ⇒ TimerAmendment

Create a timer for a subscription event. Timer","response":"createSubscriptionTimer.html","request":"createSubscriptionTimer.request.html"

Parameters:

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

    the optional parameters

Returns:



709
710
711
712
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 709

def create_timer(subscription_id, request, opts = {})
  data, _status_code, _headers = create_timer_with_http_info(subscription_id, request, opts)
  return data
end

#create_timer_with_http_info(subscription_id, request, opts = {}) ⇒ Array<(TimerAmendment, Fixnum, Hash)>

Create a timer for a subscription event. Timer&quot;,&quot;response&quot;:&quot;createSubscriptionTimer.html&quot;,&quot;request&quot;:&quot;createSubscriptionTimer.request.html&quot;

Parameters:

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

    the optional parameters

Returns:

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

    TimerAmendment data, response status code and response headers



720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 720

def create_timer_with_http_info(subscription_id, request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SubscriptionsApi.create_timer ..."
  end
  # verify the required parameter 'subscription_id' is set
  fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.create_timer" if subscription_id.nil?
  # verify the required parameter 'request' is set
  fail ArgumentError, "Missing the required parameter 'request' when calling SubscriptionsApi.create_timer" if request.nil?
  # resource path
  local_var_path = "/subscriptions/{subscription-ID}/timer".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(request)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'TimerAmendment')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#create_timer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_metadata_for_subscription(subscription_id, opts = {}) ⇒ DynamicMetadata

Remove any associated metadata. from subscription","request" :"deleteSubscriptionMetadataRequest.html","response":"deleteSubscriptionMetadataResponse.html"

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

Returns:



770
771
772
773
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 770

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

#delete_metadata_for_subscription_with_http_info(subscription_id, opts = {}) ⇒ Array<(DynamicMetadata, Fixnum, Hash)>

Remove any associated metadata. from subscription&quot;,&quot;request&quot; :&quot;deleteSubscriptionMetadataRequest.html&quot;,&quot;response&quot;:&quot;deleteSubscriptionMetadataResponse.html&quot;

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

Returns:

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

    DynamicMetadata data, response status code and response headers



781
782
783
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
816
817
818
819
820
821
822
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 781

def (subscription_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SubscriptionsApi.delete_metadata_for_subscription ..."
  end
  # verify the required parameter 'subscription_id' is set
  fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.delete_metadata_for_subscription" if subscription_id.nil?
  # resource path
  local_var_path = "/subscriptions/{subscription-ID}/metadata".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)

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

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

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

#freeze_subscription(subscription_id, request, opts = {}) ⇒ SubscriptionPagedMetadata

Freeze the subscription. Bfwd::SubscriptionsApi."nickname":"Freeze","request":"freezeSubscriptionRequest.html","response":"freezeSubscription"nickname":"Freeze","request":"freezeSubscriptionRequest.html","response":"freezeSubscription.html"

Parameters:

  • subscription_id

    ID of the subscription.

  • request

    The request

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

    the optional parameters

Returns:



830
831
832
833
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 830

def freeze_subscription(subscription_id, request, opts = {})
  data, _status_code, _headers = freeze_subscription_with_http_info(subscription_id, request, opts)
  return data
end

#freeze_subscription_with_http_info(subscription_id, request, opts = {}) ⇒ Array<(SubscriptionPagedMetadata, Fixnum, Hash)>

Freeze the subscription. Bfwd::SubscriptionsApi.&quot;nickname&quot;:&quot;Freeze&quot;,&quot;request&quot;:&quot;freezeSubscriptionRequest.html&quot;,&quot;response&quot;:&quot;freezeSubscription&quot;nickname&quot;:&quot;Freeze&quot;,&quot;request&quot;:&quot;freezeSubscriptionRequest.html&quot;,&quot;response&quot;:&quot;freezeSubscription.html&quot;

Parameters:

  • subscription_id

    ID of the subscription.

  • request

    The request

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

    the optional parameters

Returns:

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

    SubscriptionPagedMetadata data, response status code and response headers



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
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 841

def freeze_subscription_with_http_info(subscription_id, request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SubscriptionsApi.freeze_subscription ..."
  end
  # verify the required parameter 'subscription_id' is set
  fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.freeze_subscription" if subscription_id.nil?
  # verify the required parameter 'request' is set
  fail ArgumentError, "Missing the required parameter 'request' when calling SubscriptionsApi.freeze_subscription" if request.nil?
  # resource path
  local_var_path = "/subscriptions/{subscription-ID}/freeze".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(request)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SubscriptionPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#freeze_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_all_subscriptions(opts = {}) ⇒ SubscriptionPagedMetadata

Retrieves a collection of all subscriptions. By default 10 values are returned. Records are returned in natural order. all subscriptions","response":"getSubscriptionAll.html"

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

  • :offset (Integer)

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

  • :records (Integer)

    The maximum number of subscriptions to return. (default to 10)

  • :order_by (String)

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

  • :order (String)

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

  • :include_retired (BOOLEAN)

    Whether retired subscriptions should be returned. (default to false)

  • :exclude_children (BOOLEAN)

    Should child subscriptiosn be excluded. (default to true)

  • :metadata (String)
  • :exclude_service_ended (BOOLEAN)
  • :account_id (Array<String>)

    A list of accountIDs to filter subscriptions on

Returns:



899
900
901
902
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 899

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

#get_all_subscriptions_with_http_info(opts = {}) ⇒ Array<(SubscriptionPagedMetadata, Fixnum, Hash)>

Retrieves a collection of all subscriptions. By default 10 values are returned. Records are returned in natural order. all subscriptions&quot;,&quot;response&quot;:&quot;getSubscriptionAll.html&quot;

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

  • :offset (Integer)

    The offset from the first subscription to return.

  • :records (Integer)

    The maximum number of subscriptions to return.

  • :order_by (String)

    Specify a field used to order the result set.

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC.

  • :include_retired (BOOLEAN)

    Whether retired subscriptions should be returned.

  • :exclude_children (BOOLEAN)

    Should child subscriptiosn be excluded.

  • :metadata (String)
  • :exclude_service_ended (BOOLEAN)
  • :account_id (Array<String>)

    A list of accountIDs to filter subscriptions on

Returns:

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

    SubscriptionPagedMetadata data, response status code and response headers



918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
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
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 918

def get_all_subscriptions_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SubscriptionsApi.get_all_subscriptions ..."
  end
  if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = "/subscriptions".sub('{format}','json')

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

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SubscriptionPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#get_all_subscriptions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_applicable_coupons_for_subscription(subscription_id, opts = {}) ⇒ CouponPagedMetadata

Retrieves a collection of the coupons which can be applied to this subscription. { "nickname" : "Retrieve applicable coupons","response" : "getApplicableCoupons.html" }

Parameters:

  • subscription_id

    ID of the subscription.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

  • :offset (Integer)

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

  • :records (Integer)

    The maximum number of subscriptions to return. (default to 10)

  • :order_by (String)

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

  • :order (String)

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

  • :include_retired (BOOLEAN)

    Whether retired subscriptions should be returned. (default to false)

Returns:



982
983
984
985
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 982

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

#get_applicable_coupons_for_subscription_with_http_info(subscription_id, opts = {}) ⇒ Array<(CouponPagedMetadata, Fixnum, Hash)>

Retrieves a collection of the coupons which can be applied to this subscription. { &quot;nickname&quot; : &quot;Retrieve applicable coupons&quot;,&quot;response&quot; : &quot;getApplicableCoupons.html&quot; }

Parameters:

  • subscription_id

    ID of the subscription.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

  • :offset (Integer)

    The offset from the first subscription to return.

  • :records (Integer)

    The maximum number of subscriptions to return.

  • :order_by (String)

    Specify a field used to order the result set.

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC.

  • :include_retired (BOOLEAN)

    Whether retired subscriptions should be returned.

Returns:

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

    CouponPagedMetadata data, response status code and response headers



998
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
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 998

def get_applicable_coupons_for_subscription_with_http_info(subscription_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SubscriptionsApi.get_applicable_coupons_for_subscription ..."
  end
  # verify the required parameter 'subscription_id' is set
  fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.get_applicable_coupons_for_subscription" if subscription_id.nil?
  if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = "/subscriptions/{subscription-ID}/applicable-coupons".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)

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

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CouponPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#get_applicable_coupons_for_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_available_credit_subscription(subscription_id, opts = {}) ⇒ CreditNotePagedMetadata

Returns all available credit-notes for the specified subscription. By default 10 values are returned. Records are returned in natural order. available credit","response":"getAvailableCreditSubscription.html"

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

  • :offset (Integer)

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

  • :records (Integer)

    The maximum number of subscriptions to return. (default to 10)

  • :order_by (String)

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

  • :order (String)

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

  • :include_retired (BOOLEAN)

    Whether retired subscriptions should be returned. (default to false)

Returns:



1060
1061
1062
1063
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 1060

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

#get_available_credit_subscription_with_http_info(subscription_id, opts = {}) ⇒ Array<(CreditNotePagedMetadata, Fixnum, Hash)>

Returns all available credit-notes for the specified subscription. By default 10 values are returned. Records are returned in natural order. available credit&quot;,&quot;response&quot;:&quot;getAvailableCreditSubscription.html&quot;

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

  • :offset (Integer)

    The offset from the first subscription to return.

  • :records (Integer)

    The maximum number of subscriptions to return.

  • :order_by (String)

    Specify a field used to order the result set.

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC.

  • :include_retired (BOOLEAN)

    Whether retired subscriptions should be returned.

Returns:

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

    CreditNotePagedMetadata data, response status code and response headers



1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 1076

def get_available_credit_subscription_with_http_info(subscription_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SubscriptionsApi.get_available_credit_subscription ..."
  end
  # verify the required parameter 'subscription_id' is set
  fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.get_available_credit_subscription" if subscription_id.nil?
  if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = "/subscriptions/{subscription-ID}/credit".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)

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

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CreditNotePagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#get_available_credit_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_charges_on_subscription(subscription_id, opts = {}) ⇒ SubscriptionChargePagedMetadata

Returns all charges for the specified subscription. By default 10 values are returned. Records are returned in natural order. charges","response":"getChargesSubscription.html"

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

  • :offset (Integer)

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

  • :records (Integer)

    The maximum number of subscriptions to return. (default to 10)

  • :order_by (String)

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

  • :order (String)

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

  • :state (String)

    Ihe direction of any ordering, either ASC or DESC.

  • :type (String)

    Ihe direction of any ordering, either ASC or DESC.

  • :include_retired (BOOLEAN)

    Whether retired subscriptions should be returned. (default to false)

Returns:



1140
1141
1142
1143
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 1140

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

#get_charges_on_subscription_with_http_info(subscription_id, opts = {}) ⇒ Array<(SubscriptionChargePagedMetadata, Fixnum, Hash)>

Returns all charges for the specified subscription. By default 10 values are returned. Records are returned in natural order. charges&quot;,&quot;response&quot;:&quot;getChargesSubscription.html&quot;

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

  • :offset (Integer)

    The offset from the first subscription to return.

  • :records (Integer)

    The maximum number of subscriptions to return.

  • :order_by (String)

    Specify a field used to order the result set.

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC.

  • :state (String)

    Ihe direction of any ordering, either ASC or DESC.

  • :type (String)

    Ihe direction of any ordering, either ASC or DESC.

  • :include_retired (BOOLEAN)

    Whether retired subscriptions should be returned.

Returns:



1158
1159
1160
1161
1162
1163
1164
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
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 1158

def get_charges_on_subscription_with_http_info(subscription_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SubscriptionsApi.get_charges_on_subscription ..."
  end
  # verify the required parameter 'subscription_id' is set
  fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.get_charges_on_subscription" if subscription_id.nil?
  if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  if opts[:'state'] && !['Voided', 'Pending', 'AwaitingPayment', 'Paid', 'Failed'].include?(opts[:'state'])
    fail ArgumentError, 'invalid value for "state", must be one of Voided, Pending, AwaitingPayment, Paid, Failed'
  end
  if opts[:'type'] && !['Setup', 'Upgrade', 'Manual', 'ProductRatePlanMigration', 'Arrears', 'Advance', 'Coupon', 'Usage', 'PricingComponent'].include?(opts[:'type'])
    fail ArgumentError, 'invalid value for "type", must be one of Setup, Upgrade, Manual, ProductRatePlanMigration, Arrears, Advance, Coupon, Usage, PricingComponent'
  end
  # resource path
  local_var_path = "/subscriptions/{subscription-ID}/charges".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)

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

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SubscriptionChargePagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#get_charges_on_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_children_of_subscription(subscription_id, opts = {}) ⇒ SubscriptionPagedMetadata

Return all entities whose invoices will be aggregated by the specified subscription By default 10 values are returned. Records are returned in natural order. Aggregated Entities","response":"getAggregatedEntities.html"

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

  • :offset (Integer)

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

  • :records (Integer)

    The maximum number of subscriptions to return. (default to 10)

  • :order_by (String)

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

  • :order (String)

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

  • :include_retired (BOOLEAN)

    Whether retired subscriptions should be returned. (default to false)

Returns:



1228
1229
1230
1231
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 1228

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

#get_children_of_subscription_with_http_info(subscription_id, opts = {}) ⇒ Array<(SubscriptionPagedMetadata, Fixnum, Hash)>

Return all entities whose invoices will be aggregated by the specified subscription By default 10 values are returned. Records are returned in natural order. Aggregated Entities&quot;,&quot;response&quot;:&quot;getAggregatedEntities.html&quot;

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

  • :offset (Integer)

    The offset from the first subscription to return.

  • :records (Integer)

    The maximum number of subscriptions to return.

  • :order_by (String)

    Specify a field used to order the result set.

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC.

  • :include_retired (BOOLEAN)

    Whether retired subscriptions should be returned.

Returns:

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

    SubscriptionPagedMetadata data, response status code and response headers



1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
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
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 1244

def get_children_of_subscription_with_http_info(subscription_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SubscriptionsApi.get_children_of_subscription ..."
  end
  # verify the required parameter 'subscription_id' is set
  fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.get_children_of_subscription" if subscription_id.nil?
  if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = "/subscriptions/{subscription-ID}/children".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)

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

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SubscriptionPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#get_children_of_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_coupons_on_subscription(subscription_id, opts = {}) ⇒ CouponPagedMetadata

Retrieves a collection of the coupons and the unique codes currently applied to the subscription. coupons","response":"getCoupons.html"

Parameters:

  • subscription_id

    ID of the subscription.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

  • :offset (Integer)

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

  • :records (Integer)

    The maximum number of subscriptions to return. (default to 10)

  • :order_by (String)

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

  • :order (String)

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

  • :include_retired (BOOLEAN)

    Whether retired subscriptions should be returned. (default to false)

Returns:



1306
1307
1308
1309
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 1306

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

#get_coupons_on_subscription_with_http_info(subscription_id, opts = {}) ⇒ Array<(CouponPagedMetadata, Fixnum, Hash)>

Retrieves a collection of the coupons and the unique codes currently applied to the subscription. coupons&quot;,&quot;response&quot;:&quot;getCoupons.html&quot;

Parameters:

  • subscription_id

    ID of the subscription.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

  • :offset (Integer)

    The offset from the first subscription to return.

  • :records (Integer)

    The maximum number of subscriptions to return.

  • :order_by (String)

    Specify a field used to order the result set.

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC.

  • :include_retired (BOOLEAN)

    Whether retired subscriptions should be returned.

Returns:

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

    CouponPagedMetadata data, response status code and response headers



1322
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
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 1322

def get_coupons_on_subscription_with_http_info(subscription_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SubscriptionsApi.get_coupons_on_subscription ..."
  end
  # verify the required parameter 'subscription_id' is set
  fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.get_coupons_on_subscription" if subscription_id.nil?
  if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = "/subscriptions/{subscription-ID}/coupons".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)

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

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CouponPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#get_coupons_on_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_invoices_for_subscription_by_state(subscription_id, state, opts = {}) ⇒ InvoicePagedMetadata

Retrieves a collection of invoice objects of the specified state for the given subscription. By default 10 values are returned. Records are returned in natural order. invoices by state for subscription","response":"getInvoicesForSubscriptionByState.html"

Parameters:

  • subscription_id

    The unique id of the subscription.

  • state

    The state of the invoices to retrieve.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

  • :offset (Integer)

    The offset from the first taxation-link to return. (default to 0)

  • :records (Integer)

    The maximum number of taxation-links to return. (default to 10)

  • :order_by (String)

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

  • :order (String)

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

Returns:



1384
1385
1386
1387
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 1384

def get_invoices_for_subscription_by_state(subscription_id, state, opts = {})
  data, _status_code, _headers = get_invoices_for_subscription_by_state_with_http_info(subscription_id, state, opts)
  return data
end

#get_invoices_for_subscription_by_state_with_http_info(subscription_id, state, opts = {}) ⇒ Array<(InvoicePagedMetadata, Fixnum, Hash)>

Retrieves a collection of invoice objects of the specified state for the given subscription. By default 10 values are returned. Records are returned in natural order. invoices by state for subscription&quot;,&quot;response&quot;:&quot;getInvoicesForSubscriptionByState.html&quot;

Parameters:

  • subscription_id

    The unique id of the subscription.

  • state

    The state of the invoices to retrieve.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

  • :offset (Integer)

    The offset from the first taxation-link to return.

  • :records (Integer)

    The maximum number of taxation-links to return.

  • :order_by (String)

    Specify a field used to order the result set.

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC.

Returns:

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

    InvoicePagedMetadata data, response status code and response headers



1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
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
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 1400

def get_invoices_for_subscription_by_state_with_http_info(subscription_id, state, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SubscriptionsApi.get_invoices_for_subscription_by_state ..."
  end
  # verify the required parameter 'subscription_id' is set
  fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.get_invoices_for_subscription_by_state" if subscription_id.nil?
  # verify the required parameter 'state' is set
  fail ArgumentError, "Missing the required parameter 'state' when calling SubscriptionsApi.get_invoices_for_subscription_by_state" if state.nil?
  # verify enum value
  unless ['Paid', 'Unpaid', 'Pending', 'Voided'].include?(state)
    fail ArgumentError, "invalid value for 'state', must be one of Paid, Unpaid, Pending, Voided"
  end
  if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = "/subscriptions/{subscriptionID}/invoices/{state}".sub('{format}','json').sub('{' + 'subscriptionID' + '}', subscription_id.to_s).sub('{' + 'state' + '}', state.to_s)

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

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InvoicePagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#get_invoices_for_subscription_by_state\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_metadata_for_subscription(subscription_id, opts = {}) ⇒ DynamicMetadata

Retrieve any associated metadata. on subscription","request":"getSubscriptionMetadataRequest.html","response":"getSubscriptionMetadataResponse.html"

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

Returns:



1462
1463
1464
1465
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 1462

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

#get_metadata_for_subscription_with_http_info(subscription_id, opts = {}) ⇒ Array<(DynamicMetadata, Fixnum, Hash)>

Retrieve any associated metadata. on subscription&quot;,&quot;request&quot;:&quot;getSubscriptionMetadataRequest.html&quot;,&quot;response&quot;:&quot;getSubscriptionMetadataResponse.html&quot;

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

Returns:

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

    DynamicMetadata data, response status code and response headers



1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 1473

def (subscription_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SubscriptionsApi.get_metadata_for_subscription ..."
  end
  # verify the required parameter 'subscription_id' is set
  fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.get_metadata_for_subscription" if subscription_id.nil?
  # resource path
  local_var_path = "/subscriptions/{subscription-ID}/metadata".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)

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

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'DynamicMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#get_metadata_for_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_parent_subscription(subscription_id, opts = {}) ⇒ SubscriptionPagedMetadata

Return the parent of the given subscription. parent","response":"getParentSubscription.html"

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

Returns:



1522
1523
1524
1525
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 1522

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

#get_parent_subscription_with_http_info(subscription_id, opts = {}) ⇒ Array<(SubscriptionPagedMetadata, Fixnum, Hash)>

Return the parent of the given subscription. parent&quot;,&quot;response&quot;:&quot;getParentSubscription.html&quot;

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

Returns:

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

    SubscriptionPagedMetadata data, response status code and response headers



1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 1533

def get_parent_subscription_with_http_info(subscription_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SubscriptionsApi.get_parent_subscription ..."
  end
  # verify the required parameter 'subscription_id' is set
  fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.get_parent_subscription" if subscription_id.nil?
  # resource path
  local_var_path = "/subscriptions/{subscription-ID}/parent".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)

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

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SubscriptionPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#get_parent_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_pricing_component_values_of_subscription(subscription_id, opts = {}) ⇒ PricingComponentValuePagedMetadata

Gets the subscription’s current pricing-component values. values","response":"getPricingComponentValues.html"

Parameters:

  • subscription_id

    ID of the subscription.

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

    the optional parameters

Returns:



1581
1582
1583
1584
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 1581

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

#get_pricing_component_values_of_subscription_with_http_info(subscription_id, opts = {}) ⇒ Array<(PricingComponentValuePagedMetadata, Fixnum, Hash)>

Gets the subscription&#39;s current pricing-component values. values&quot;,&quot;response&quot;:&quot;getPricingComponentValues.html&quot;

Parameters:

  • subscription_id

    ID of the subscription.

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

    the optional parameters

Returns:



1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 1591

def get_pricing_component_values_of_subscription_with_http_info(subscription_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SubscriptionsApi.get_pricing_component_values_of_subscription ..."
  end
  # verify the required parameter 'subscription_id' is set
  fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.get_pricing_component_values_of_subscription" if subscription_id.nil?
  # resource path
  local_var_path = "/subscriptions/{subscription-ID}/values".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'PricingComponentValuePagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#get_pricing_component_values_of_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_subscription_by_account_id(account_id, opts = {}) ⇒ SubscriptionPagedMetadata

Retrieves a collection of subscriptions, specified by the account-ID parameter. By default 10 values are returned. Records are returned in natural order. by account","response":"getSubscriptionByAccount.html"

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

  • :offset (Integer)

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

  • :records (Integer)

    The maximum number of subscriptions to return. (default to 10)

  • :order_by (String)

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

  • :order (String)

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

  • :include_retired (BOOLEAN)

    Whether retired subscriptions should be returned. (default to false)

  • :exclude_children (BOOLEAN)

    Should child subscriptiosn be excluded. (default to true)

Returns:



1645
1646
1647
1648
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 1645

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

#get_subscription_by_account_id_with_http_info(account_id, opts = {}) ⇒ Array<(SubscriptionPagedMetadata, Fixnum, Hash)>

Retrieves a collection of subscriptions, specified by the account-ID parameter. By default 10 values are returned. Records are returned in natural order. by account&quot;,&quot;response&quot;:&quot;getSubscriptionByAccount.html&quot;

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

  • :offset (Integer)

    The offset from the first subscription to return.

  • :records (Integer)

    The maximum number of subscriptions to return.

  • :order_by (String)

    Specify a field used to order the result set.

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC.

  • :include_retired (BOOLEAN)

    Whether retired subscriptions should be returned.

  • :exclude_children (BOOLEAN)

    Should child subscriptiosn be excluded.

Returns:

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

    SubscriptionPagedMetadata data, response status code and response headers



1662
1663
1664
1665
1666
1667
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
1709
1710
1711
1712
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 1662

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

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

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SubscriptionPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#get_subscription_by_account_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_subscription_by_id(subscription_id, opts = {}) ⇒ SubscriptionPagedMetadata

Retrieves a single subscription, specified by the ID parameter. an existing subscription","response":"getSubscriptionByID.html"

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

  • :include_retired (BOOLEAN)

    Whether retired subscriptions should be returned. (default to false)

Returns:



1721
1722
1723
1724
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 1721

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

#get_subscription_by_id_with_http_info(subscription_id, opts = {}) ⇒ Array<(SubscriptionPagedMetadata, Fixnum, Hash)>

Retrieves a single subscription, specified by the ID parameter. an existing subscription&quot;,&quot;response&quot;:&quot;getSubscriptionByID.html&quot;

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

  • :include_retired (BOOLEAN)

    Whether retired subscriptions should be returned.

Returns:

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

    SubscriptionPagedMetadata data, response status code and response headers



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
1767
1768
1769
1770
1771
1772
1773
1774
1775
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 1733

def get_subscription_by_id_with_http_info(subscription_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SubscriptionsApi.get_subscription_by_id ..."
  end
  # verify the required parameter 'subscription_id' is set
  fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.get_subscription_by_id" if subscription_id.nil?
  # resource path
  local_var_path = "/subscriptions/{subscription-ID}".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)

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

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SubscriptionPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#get_subscription_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_subscription_by_product_id(product_id, opts = {}) ⇒ SubscriptionPagedMetadata

Retrieves a collection of subscriptions, specified by the product-ID parameter. By default 10 values are returned. Records are returned in natural order. by product","response":"getSubscriptionByProduct.html"

Parameters:

  • product_id

    ID of the product

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

  • :offset (Integer)

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

  • :records (Integer)

    The maximum number of subscriptions to return. (default to 10)

  • :order_by (String)

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

  • :order (String)

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

  • :include_retired (BOOLEAN)

    Whether retired subscriptions should be returned. (default to false)

  • :exclude_children (BOOLEAN)

    Should child subscriptiosn be excluded. (default to true)

Returns:



1789
1790
1791
1792
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 1789

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

#get_subscription_by_product_id_with_http_info(product_id, opts = {}) ⇒ Array<(SubscriptionPagedMetadata, Fixnum, Hash)>

Retrieves a collection of subscriptions, specified by the product-ID parameter. By default 10 values are returned. Records are returned in natural order. by product&quot;,&quot;response&quot;:&quot;getSubscriptionByProduct.html&quot;

Parameters:

  • product_id

    ID of the product

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

  • :offset (Integer)

    The offset from the first subscription to return.

  • :records (Integer)

    The maximum number of subscriptions to return.

  • :order_by (String)

    Specify a field used to order the result set.

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC.

  • :include_retired (BOOLEAN)

    Whether retired subscriptions should be returned.

  • :exclude_children (BOOLEAN)

    Should child subscriptiosn be excluded.

Returns:

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

    SubscriptionPagedMetadata data, response status code and response headers



1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 1806

def get_subscription_by_product_id_with_http_info(product_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SubscriptionsApi.get_subscription_by_product_id ..."
  end
  # verify the required parameter 'product_id' is set
  fail ArgumentError, "Missing the required parameter 'product_id' when calling SubscriptionsApi.get_subscription_by_product_id" if product_id.nil?
  if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = "/subscriptions/product/{product-ID}".sub('{format}','json').sub('{' + 'product-ID' + '}', product_id.to_s)

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

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SubscriptionPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#get_subscription_by_product_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_subscription_by_product_rate_plan_id(product_rate_plan_id, opts = {}) ⇒ SubscriptionPagedMetadata

Retrieves a collection of subscriptions, specified by the product-rate-plan-ID parameter. By default 10 values are returned. Records are returned in natural order. by rate-plan","response":"getSubscriptionByProductRatePlan.html"

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

  • :offset (Integer)

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

  • :records (Integer)

    The maximum number of subscriptions to return. (default to 10)

  • :order_by (String)

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

  • :order (String)

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

  • :include_retired (BOOLEAN)

    Whether retired subscriptions should be returned. (default to false)

  • :exclude_children (BOOLEAN)

    Should child subscriptiosn be excluded. (default to true)

Returns:



1870
1871
1872
1873
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 1870

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

#get_subscription_by_product_rate_plan_id_with_http_info(product_rate_plan_id, opts = {}) ⇒ Array<(SubscriptionPagedMetadata, Fixnum, Hash)>

Retrieves a collection of subscriptions, specified by the product-rate-plan-ID parameter. By default 10 values are returned. Records are returned in natural order. by rate-plan&quot;,&quot;response&quot;:&quot;getSubscriptionByProductRatePlan.html&quot;

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

  • :offset (Integer)

    The offset from the first subscription to return.

  • :records (Integer)

    The maximum number of subscriptions to return.

  • :order_by (String)

    Specify a field used to order the result set.

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC.

  • :include_retired (BOOLEAN)

    Whether retired subscriptions should be returned.

  • :exclude_children (BOOLEAN)

    Should child subscriptiosn be excluded.

Returns:

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

    SubscriptionPagedMetadata data, response status code and response headers



1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 1887

def get_subscription_by_product_rate_plan_id_with_http_info(product_rate_plan_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SubscriptionsApi.get_subscription_by_product_rate_plan_id ..."
  end
  # verify the required parameter 'product_rate_plan_id' is set
  fail ArgumentError, "Missing the required parameter 'product_rate_plan_id' when calling SubscriptionsApi.get_subscription_by_product_rate_plan_id" if product_rate_plan_id.nil?
  if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = "/subscriptions/product-rate-plan/{product-rate-plan-ID}".sub('{format}','json').sub('{' + 'product-rate-plan-ID' + '}', product_rate_plan_id.to_s)

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

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SubscriptionPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#get_subscription_by_product_rate_plan_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_subscription_by_state(state, opts = {}) ⇒ SubscriptionPagedMetadata

Retrieves a collection of subscriptions, specified by the state parameter. By default 10 values are returned. Records are returned in natural order. by state","response":"getSubscriptionByState.html"

Parameters:

  • state

    The current state of the subscription, either Provisioned, AwaitingPayment, Paid or Cancelled

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

  • :offset (Integer)

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

  • :records (Integer)

    The maximum number of subscriptions to return. (default to 10)

  • :order_by (String)

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

  • :order (String)

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

  • :include_retired (BOOLEAN)

    Whether retired subscriptions should be returned. (default to false)

  • :exclude_children (BOOLEAN)

    Should child subscriptiosn be excluded. (default to true)

Returns:



1951
1952
1953
1954
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 1951

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

#get_subscription_by_state_with_http_info(state, opts = {}) ⇒ Array<(SubscriptionPagedMetadata, Fixnum, Hash)>

Retrieves a collection of subscriptions, specified by the state parameter. By default 10 values are returned. Records are returned in natural order. by state&quot;,&quot;response&quot;:&quot;getSubscriptionByState.html&quot;

Parameters:

  • state

    The current state of the subscription, either Provisioned, AwaitingPayment, Paid or Cancelled

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

  • :offset (Integer)

    The offset from the first subscription to return.

  • :records (Integer)

    The maximum number of subscriptions to return.

  • :order_by (String)

    Specify a field used to order the result set.

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC.

  • :include_retired (BOOLEAN)

    Whether retired subscriptions should be returned.

  • :exclude_children (BOOLEAN)

    Should child subscriptiosn be excluded.

Returns:

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

    SubscriptionPagedMetadata data, response status code and response headers



1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 1968

def get_subscription_by_state_with_http_info(state, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SubscriptionsApi.get_subscription_by_state ..."
  end
  # verify the required parameter 'state' is set
  fail ArgumentError, "Missing the required parameter 'state' when calling SubscriptionsApi.get_subscription_by_state" if state.nil?
  # verify enum value
  unless ['Trial', 'Provisioned', 'Paid', 'AwaitingPayment', 'Cancelled', 'Failed', 'Expired'].include?(state)
    fail ArgumentError, "invalid value for 'state', must be one of Trial, Provisioned, Paid, AwaitingPayment, Cancelled, Failed, Expired"
  end
  if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = "/subscriptions/state/{state}".sub('{format}','json').sub('{' + 'state' + '}', state.to_s)

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

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SubscriptionPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#get_subscription_by_state\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_subscription_by_version_id(version_id, opts = {}) ⇒ SubscriptionPagedMetadata

Retrieves a single subscription, specified by the version-ID parameter. by version","response":"getSubscriptionByVersionID.html"

Parameters:

  • version_id

    The version-ID of the subscription.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

Returns:



2030
2031
2032
2033
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 2030

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

#get_subscription_by_version_id_with_http_info(version_id, opts = {}) ⇒ Array<(SubscriptionPagedMetadata, Fixnum, Hash)>

Retrieves a single subscription, specified by the version-ID parameter. by version&quot;,&quot;response&quot;:&quot;getSubscriptionByVersionID.html&quot;

Parameters:

  • version_id

    The version-ID of the subscription.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

Returns:

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

    SubscriptionPagedMetadata data, response status code and response headers



2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 2041

def get_subscription_by_version_id_with_http_info(version_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SubscriptionsApi.get_subscription_by_version_id ..."
  end
  # verify the required parameter 'version_id' is set
  fail ArgumentError, "Missing the required parameter 'version_id' when calling SubscriptionsApi.get_subscription_by_version_id" if version_id.nil?
  # resource path
  local_var_path = "/subscriptions/version/{version-ID}".sub('{format}','json').sub('{' + 'version-ID' + '}', version_id.to_s)

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

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SubscriptionPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#get_subscription_by_version_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_subscriptions_by_initial_period_start(lower_threshold, upper_threshold, opts = {}) ⇒ SubscriptionPagedMetadata

Retrieves a collection of subscription objects with period-end times within the period specified by the lower-threshold and upper-threshold parameters. By default 10 values are returned. Records are returned in natural order. by initial period-start","response":"getSubscriptionByInitialPeriodStart.html"

Parameters:

  • lower_threshold

    The UTC DateTime specifying the start of the result period.

  • upper_threshold

    The UTC DateTime specifying the end of the result period.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

  • :offset (Integer)

    The offset from the first taxation-link to return. (default to 0)

  • :records (Integer)

    The maximum number of taxation-links to return. (default to 10)

  • :order_by (String)

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

  • :order (String)

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

Returns:



2095
2096
2097
2098
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 2095

def get_subscriptions_by_initial_period_start(lower_threshold, upper_threshold, opts = {})
  data, _status_code, _headers = get_subscriptions_by_initial_period_start_with_http_info(lower_threshold, upper_threshold, opts)
  return data
end

#get_subscriptions_by_initial_period_start_with_http_info(lower_threshold, upper_threshold, opts = {}) ⇒ Array<(SubscriptionPagedMetadata, Fixnum, Hash)>

Retrieves a collection of subscription objects with period-end times within the period specified by the lower-threshold and upper-threshold parameters. By default 10 values are returned. Records are returned in natural order. by initial period-start&quot;,&quot;response&quot;:&quot;getSubscriptionByInitialPeriodStart.html&quot;

Parameters:

  • lower_threshold

    The UTC DateTime specifying the start of the result period.

  • upper_threshold

    The UTC DateTime specifying the end of the result period.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

  • :offset (Integer)

    The offset from the first taxation-link to return.

  • :records (Integer)

    The maximum number of taxation-links to return.

  • :order_by (String)

    Specify a field used to order the result set.

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC.

Returns:

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

    SubscriptionPagedMetadata data, response status code and response headers



2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 2111

def get_subscriptions_by_initial_period_start_with_http_info(lower_threshold, upper_threshold, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SubscriptionsApi.get_subscriptions_by_initial_period_start ..."
  end
  # verify the required parameter 'lower_threshold' is set
  fail ArgumentError, "Missing the required parameter 'lower_threshold' when calling SubscriptionsApi.get_subscriptions_by_initial_period_start" if lower_threshold.nil?
  # verify the required parameter 'upper_threshold' is set
  fail ArgumentError, "Missing the required parameter 'upper_threshold' when calling SubscriptionsApi.get_subscriptions_by_initial_period_start" if upper_threshold.nil?
  if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = "/subscriptions/initial-period-start/{lower-threshold}/{upper-threshold}".sub('{format}','json').sub('{' + 'lower-threshold' + '}', lower_threshold.to_s).sub('{' + 'upper-threshold' + '}', upper_threshold.to_s)

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

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SubscriptionPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#get_subscriptions_by_initial_period_start\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_subscriptions_by_period_end(lower_threshold, upper_threshold, opts = {}) ⇒ SubscriptionPagedMetadata

Retrieves a collection of subscription objects with period-end times within the period specified by the lower-threshold and upper-threshold parameters. By default 10 values are returned. Records are returned in natural order. by period-end","response":"getSubscriptionByPeriodEnd.html"

Parameters:

  • lower_threshold

    The UTC DateTime specifying the start of the result period.

  • upper_threshold

    The UTC DateTime specifying the end of the result period.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

  • :offset (Integer)

    The offset from the first taxation-link to return. (default to 0)

  • :records (Integer)

    The maximum number of taxation-links to return. (default to 10)

  • :order_by (String)

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

  • :order (String)

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

Returns:



2174
2175
2176
2177
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 2174

def get_subscriptions_by_period_end(lower_threshold, upper_threshold, opts = {})
  data, _status_code, _headers = get_subscriptions_by_period_end_with_http_info(lower_threshold, upper_threshold, opts)
  return data
end

#get_subscriptions_by_period_end_with_http_info(lower_threshold, upper_threshold, opts = {}) ⇒ Array<(SubscriptionPagedMetadata, Fixnum, Hash)>

Retrieves a collection of subscription objects with period-end times within the period specified by the lower-threshold and upper-threshold parameters. By default 10 values are returned. Records are returned in natural order. by period-end&quot;,&quot;response&quot;:&quot;getSubscriptionByPeriodEnd.html&quot;

Parameters:

  • lower_threshold

    The UTC DateTime specifying the start of the result period.

  • upper_threshold

    The UTC DateTime specifying the end of the result period.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

  • :offset (Integer)

    The offset from the first taxation-link to return.

  • :records (Integer)

    The maximum number of taxation-links to return.

  • :order_by (String)

    Specify a field used to order the result set.

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC.

Returns:

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

    SubscriptionPagedMetadata data, response status code and response headers



2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 2190

def get_subscriptions_by_period_end_with_http_info(lower_threshold, upper_threshold, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SubscriptionsApi.get_subscriptions_by_period_end ..."
  end
  # verify the required parameter 'lower_threshold' is set
  fail ArgumentError, "Missing the required parameter 'lower_threshold' when calling SubscriptionsApi.get_subscriptions_by_period_end" if lower_threshold.nil?
  # verify the required parameter 'upper_threshold' is set
  fail ArgumentError, "Missing the required parameter 'upper_threshold' when calling SubscriptionsApi.get_subscriptions_by_period_end" if upper_threshold.nil?
  if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = "/subscriptions/period-end/{lower-threshold}/{upper-threshold}".sub('{format}','json').sub('{' + 'lower-threshold' + '}', lower_threshold.to_s).sub('{' + 'upper-threshold' + '}', upper_threshold.to_s)

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

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SubscriptionPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#get_subscriptions_by_period_end\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_subscriptions_by_period_start(lower_threshold, upper_threshold, opts = {}) ⇒ SubscriptionPagedMetadata

Retrieves a collection of subscription objects with period-start times within the period specified by the lower-threshold and upper-threshold parameters. By default 10 values are returned. Records are returned in natural order. by period-start","response":"getSubscriptionByPeriodStart.html"

Parameters:

  • lower_threshold

    The UTC DateTime specifying the start of the result period.

  • upper_threshold

    The UTC DateTime specifying the end of the result period.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

  • :offset (Integer)

    The offset from the first taxation-link to return. (default to 0)

  • :records (Integer)

    The maximum number of taxation-links to return. (default to 10)

  • :order_by (String)

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

  • :order (String)

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

Returns:



2253
2254
2255
2256
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 2253

def get_subscriptions_by_period_start(lower_threshold, upper_threshold, opts = {})
  data, _status_code, _headers = get_subscriptions_by_period_start_with_http_info(lower_threshold, upper_threshold, opts)
  return data
end

#get_subscriptions_by_period_start_with_http_info(lower_threshold, upper_threshold, opts = {}) ⇒ Array<(SubscriptionPagedMetadata, Fixnum, Hash)>

Retrieves a collection of subscription objects with period-start times within the period specified by the lower-threshold and upper-threshold parameters. By default 10 values are returned. Records are returned in natural order. by period-start&quot;,&quot;response&quot;:&quot;getSubscriptionByPeriodStart.html&quot;

Parameters:

  • lower_threshold

    The UTC DateTime specifying the start of the result period.

  • upper_threshold

    The UTC DateTime specifying the end of the result period.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

  • :offset (Integer)

    The offset from the first taxation-link to return.

  • :records (Integer)

    The maximum number of taxation-links to return.

  • :order_by (String)

    Specify a field used to order the result set.

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC.

Returns:

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

    SubscriptionPagedMetadata data, response status code and response headers



2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 2269

def get_subscriptions_by_period_start_with_http_info(lower_threshold, upper_threshold, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SubscriptionsApi.get_subscriptions_by_period_start ..."
  end
  # verify the required parameter 'lower_threshold' is set
  fail ArgumentError, "Missing the required parameter 'lower_threshold' when calling SubscriptionsApi.get_subscriptions_by_period_start" if lower_threshold.nil?
  # verify the required parameter 'upper_threshold' is set
  fail ArgumentError, "Missing the required parameter 'upper_threshold' when calling SubscriptionsApi.get_subscriptions_by_period_start" if upper_threshold.nil?
  if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = "/subscriptions/period-start/{lower-threshold}/{upper-threshold}".sub('{format}','json').sub('{' + 'lower-threshold' + '}', lower_threshold.to_s).sub('{' + 'upper-threshold' + '}', upper_threshold.to_s)

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

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SubscriptionPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#get_subscriptions_by_period_start\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_subscriptions_by_successful_periods(lower_threshold, upper_threshold, opts = {}) ⇒ SubscriptionPagedMetadata

Retrieves a collection of subscription objects whose successful periods count falls within the range specified by the lower-threshold and upper-threshold parameters. By default 10 values are returned. Records are returned in natural order. by successful period","response":"getSubscriptionBySuccessfulPeriods.html"

Parameters:

  • lower_threshold

    The lower threshold of the range

  • upper_threshold

    The upper threshold of the range.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

  • :offset (Integer)

    The offset from the first taxation-link to return. (default to 0)

  • :records (Integer)

    The maximum number of taxation-links to return. (default to 10)

  • :order_by (String)

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

  • :order (String)

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

Returns:



2332
2333
2334
2335
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 2332

def get_subscriptions_by_successful_periods(lower_threshold, upper_threshold, opts = {})
  data, _status_code, _headers = get_subscriptions_by_successful_periods_with_http_info(lower_threshold, upper_threshold, opts)
  return data
end

#get_subscriptions_by_successful_periods_with_http_info(lower_threshold, upper_threshold, opts = {}) ⇒ Array<(SubscriptionPagedMetadata, Fixnum, Hash)>

Retrieves a collection of subscription objects whose successful periods count falls within the range specified by the lower-threshold and upper-threshold parameters. By default 10 values are returned. Records are returned in natural order. by successful period&quot;,&quot;response&quot;:&quot;getSubscriptionBySuccessfulPeriods.html&quot;

Parameters:

  • lower_threshold

    The lower threshold of the range

  • upper_threshold

    The upper threshold of the range.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

  • :offset (Integer)

    The offset from the first taxation-link to return.

  • :records (Integer)

    The maximum number of taxation-links to return.

  • :order_by (String)

    Specify a field used to order the result set.

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC.

Returns:

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

    SubscriptionPagedMetadata data, response status code and response headers



2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 2348

def get_subscriptions_by_successful_periods_with_http_info(lower_threshold, upper_threshold, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SubscriptionsApi.get_subscriptions_by_successful_periods ..."
  end
  # verify the required parameter 'lower_threshold' is set
  fail ArgumentError, "Missing the required parameter 'lower_threshold' when calling SubscriptionsApi.get_subscriptions_by_successful_periods" if lower_threshold.nil?
  # verify the required parameter 'upper_threshold' is set
  fail ArgumentError, "Missing the required parameter 'upper_threshold' when calling SubscriptionsApi.get_subscriptions_by_successful_periods" if upper_threshold.nil?
  if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = "/subscriptions/successful-periods/{lower-threshold}/{upper-threshold}".sub('{format}','json').sub('{' + 'lower-threshold' + '}', lower_threshold.to_s).sub('{' + 'upper-threshold' + '}', upper_threshold.to_s)

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

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SubscriptionPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#get_subscriptions_by_successful_periods\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_swagger_subscription(query_string, opts = {}) ⇒ SwaggerTypeListSubs

{ "nickname" : "","response" : ""}

Parameters:

  • query_string

    The query string used to search.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

  • :offset (Integer)

    The starting index of the search results. (default to 0)

  • :records (Integer)

    The number of search results to return. (default to 10)

  • :format (String)

    The response format, either JSON or XML. (default to JSON)

  • :wildcard (BOOLEAN)

    Toggle if we search for full words or whether a wildcard is used. (default to false)

  • :entity (BOOLEAN)

    Is an entity returned with the search results. (default to false)

Returns:



2411
2412
2413
2414
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 2411

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

#get_swagger_subscription_with_http_info(query_string, opts = {}) ⇒ Array<(SwaggerTypeListSubs, Fixnum, Hash)>

{ &quot;nickname&quot; : &quot;&quot;,&quot;response&quot; : &quot;&quot;}

Parameters:

  • query_string

    The query string used to search.

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

  • :offset (Integer)

    The starting index of the search results.

  • :records (Integer)

    The number of search results to return.

  • :format (String)

    The response format, either JSON or XML.

  • :wildcard (BOOLEAN)

    Toggle if we search for full words or whether a wildcard is used.

  • :entity (BOOLEAN)

    Is an entity returned with the search results.

Returns:

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

    SwaggerTypeListSubs data, response status code and response headers



2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 2427

def get_swagger_subscription_with_http_info(query_string, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SubscriptionsApi.get_swagger_subscription ..."
  end
  # verify the required parameter 'query_string' is set
  fail ArgumentError, "Missing the required parameter 'query_string' when calling SubscriptionsApi.get_swagger_subscription" if query_string.nil?
  # resource path
  local_var_path = "/subscriptions/swagger-end-point/{query-string}".sub('{format}','json').sub('{' + 'query-string' + '}', query_string.to_s)

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

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SwaggerTypeListSubs')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#get_swagger_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_timers_for_subscription(subscription_id, opts = {}) ⇒ TimerAmendment

Retrieves a collection timer amendments for the specified subscription.. By default 10 values are returned. Records are returned in natural order. Timers","response":"getTimersforSubscription.html"

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

  • :offset (Integer)

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

  • :records (Integer)

    The maximum number of subscriptions to return. (default to 10)

  • :order_by (String)

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

  • :order (String)

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

  • :include_retired (BOOLEAN)

    Whether retired timers should be returned. (default to false)

  • :state (String)

    The state of the timer amendment

  • :event (String)

    The type of timer event

Returns:



2488
2489
2490
2491
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 2488

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

#get_timers_for_subscription_with_http_info(subscription_id, opts = {}) ⇒ Array<(TimerAmendment, Fixnum, Hash)>

Retrieves a collection timer amendments for the specified subscription.. By default 10 values are returned. Records are returned in natural order. Timers&quot;,&quot;response&quot;:&quot;getTimersforSubscription.html&quot;

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

  • :offset (Integer)

    The offset from the first subscription to return.

  • :records (Integer)

    The maximum number of subscriptions to return.

  • :order_by (String)

    Specify a field used to order the result set.

  • :order (String)

    Ihe direction of any ordering, either ASC or DESC.

  • :include_retired (BOOLEAN)

    Whether retired timers should be returned.

  • :state (String)

    The state of the timer amendment

  • :event (String)

    The type of timer event

Returns:

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

    TimerAmendment data, response status code and response headers



2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 2506

def get_timers_for_subscription_with_http_info(subscription_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SubscriptionsApi.get_timers_for_subscription ..."
  end
  # verify the required parameter 'subscription_id' is set
  fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.get_timers_for_subscription" if subscription_id.nil?
  if opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  if opts[:'state'] && !['Pending', 'Succeeded', 'Failed', 'Discarded'].include?(opts[:'state'])
    fail ArgumentError, 'invalid value for "state", must be one of Pending, Succeeded, Failed, Discarded'
  end
  if opts[:'event'] && !['TrialExpiry', 'SubscriptionExpiry', 'PeriodEnd'].include?(opts[:'event'])
    fail ArgumentError, 'invalid value for "event", must be one of TrialExpiry, SubscriptionExpiry, PeriodEnd'
  end
  # resource path
  local_var_path = "/subscriptions/{subscription-ID}/timer".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)

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

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'TimerAmendment')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#get_timers_for_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#import_subscription(request, opts = {}) ⇒ SubscriptionPagedMetadata

Import a subscription. Bfwd::SubscriptionsApi."nickname":"Import","request":"importSubscriptionRequest.html","response":"importSubscription"nickname":"Import","request":"importSubscriptionRequest.html","response":"importSubscription.html"

Parameters:

  • request

    The request

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

    the optional parameters

Returns:



2570
2571
2572
2573
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 2570

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

#import_subscription_with_http_info(request, opts = {}) ⇒ Array<(SubscriptionPagedMetadata, Fixnum, Hash)>

Import a subscription. Bfwd::SubscriptionsApi.&quot;nickname&quot;:&quot;Import&quot;,&quot;request&quot;:&quot;importSubscriptionRequest.html&quot;,&quot;response&quot;:&quot;importSubscription&quot;nickname&quot;:&quot;Import&quot;,&quot;request&quot;:&quot;importSubscriptionRequest.html&quot;,&quot;response&quot;:&quot;importSubscription.html&quot;

Parameters:

  • request

    The request

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

    the optional parameters

Returns:

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

    SubscriptionPagedMetadata data, response status code and response headers



2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 2580

def import_subscription_with_http_info(request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SubscriptionsApi.import_subscription ..."
  end
  # verify the required parameter 'request' is set
  fail ArgumentError, "Missing the required parameter 'request' when calling SubscriptionsApi.import_subscription" if request.nil?
  # resource path
  local_var_path = "/subscriptions/import".sub('{format}','json')

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(request)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SubscriptionPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#import_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#invoice_charges_on_subscription(subscription_id, charge, opts = {}) ⇒ InvoicePagedMetadata

Invoice any outstanding charges for the subscription. Charges","request":"invoiceChargesRequest.html","response":"invoiceCharges.html"

Parameters:

  • subscription_id

    ID of the subscription.

  • charge

    The charge request

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

    the optional parameters

Returns:



2628
2629
2630
2631
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 2628

def invoice_charges_on_subscription(subscription_id, charge, opts = {})
  data, _status_code, _headers = invoice_charges_on_subscription_with_http_info(subscription_id, charge, opts)
  return data
end

#invoice_charges_on_subscription_with_http_info(subscription_id, charge, opts = {}) ⇒ Array<(InvoicePagedMetadata, Fixnum, Hash)>

Invoice any outstanding charges for the subscription. Charges&quot;,&quot;request&quot;:&quot;invoiceChargesRequest.html&quot;,&quot;response&quot;:&quot;invoiceCharges.html&quot;

Parameters:

  • subscription_id

    ID of the subscription.

  • charge

    The charge request

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

    the optional parameters

Returns:

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

    InvoicePagedMetadata data, response status code and response headers



2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 2639

def invoice_charges_on_subscription_with_http_info(subscription_id, charge, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SubscriptionsApi.invoice_charges_on_subscription ..."
  end
  # verify the required parameter 'subscription_id' is set
  fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.invoice_charges_on_subscription" if subscription_id.nil?
  # verify the required parameter 'charge' is set
  fail ArgumentError, "Missing the required parameter 'charge' when calling SubscriptionsApi.invoice_charges_on_subscription" if charge.nil?
  # resource path
  local_var_path = "/subscriptions/{subscription-ID}/invoice-charges".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(charge)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InvoicePagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#invoice_charges_on_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#migrate_subscription(subscription_id, request, opts = {}) ⇒ SubscriptionPagedMetadata

Migrate the subscription to a new plan. "response":"migrateSubscription.html"

Parameters:

  • subscription_id

    ID of the subscription.

  • request

    The migration request

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

    the optional parameters

Returns:



2689
2690
2691
2692
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 2689

def migrate_subscription(subscription_id, request, opts = {})
  data, _status_code, _headers = migrate_subscription_with_http_info(subscription_id, request, opts)
  return data
end

#migrate_subscription_with_http_info(subscription_id, request, opts = {}) ⇒ Array<(SubscriptionPagedMetadata, Fixnum, Hash)>

Migrate the subscription to a new plan. &quot;response&quot;:&quot;migrateSubscription.html&quot;

Parameters:

  • subscription_id

    ID of the subscription.

  • request

    The migration request

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

    the optional parameters

Returns:

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

    SubscriptionPagedMetadata data, response status code and response headers



2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 2700

def migrate_subscription_with_http_info(subscription_id, request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SubscriptionsApi.migrate_subscription ..."
  end
  # verify the required parameter 'subscription_id' is set
  fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.migrate_subscription" if subscription_id.nil?
  # verify the required parameter 'request' is set
  fail ArgumentError, "Missing the required parameter 'request' when calling SubscriptionsApi.migrate_subscription" if request.nil?
  # resource path
  local_var_path = "/subscriptions/{subscription-ID}/migrate".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(request)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SubscriptionPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#migrate_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#remove_coupon_from_subscription(subscription_id, coupon_code, opts = {}) ⇒ CouponPagedMetadata

Removes the coupon from the subscription. coupon","response":"removeCouponResponse.html"

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

Returns:



2751
2752
2753
2754
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 2751

def remove_coupon_from_subscription(subscription_id, coupon_code, opts = {})
  data, _status_code, _headers = remove_coupon_from_subscription_with_http_info(subscription_id, coupon_code, opts)
  return data
end

#remove_coupon_from_subscription_with_http_info(subscription_id, coupon_code, opts = {}) ⇒ Array<(CouponPagedMetadata, Fixnum, Hash)>

Removes the coupon from the subscription. coupon&quot;,&quot;response&quot;:&quot;removeCouponResponse.html&quot;

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

Returns:

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

    CouponPagedMetadata data, response status code and response headers



2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 2763

def remove_coupon_from_subscription_with_http_info(subscription_id, coupon_code, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SubscriptionsApi.remove_coupon_from_subscription ..."
  end
  # verify the required parameter 'subscription_id' is set
  fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.remove_coupon_from_subscription" if subscription_id.nil?
  # verify the required parameter 'coupon_code' is set
  fail ArgumentError, "Missing the required parameter 'coupon_code' when calling SubscriptionsApi.remove_coupon_from_subscription" if coupon_code.nil?
  # resource path
  local_var_path = "/subscriptions/{subscription-ID}/coupons/{coupon-code}".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s).sub('{' + 'coupon-code' + '}', coupon_code.to_s)

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

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

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

#remove_credit_from_subscription(subscription_id, value, opts = {}) ⇒ CreditNotePagedMetadata

Decrease the amount of credit available to the specified subscription. Credit","response":"removeCreditForSubscription.html"

Parameters:

  • subscription_id
  • value

    &lt;p&gt;Either a credit note ID or a currency value.&lt;/p&gt;&lt;p&gt;If a credit note ID is provided any remaining credit will be removed.&lt;/p&gt;&lt;p&gt;If a decimal is provided this value will be removed from any credit available to the subscription. For example if the subscription is in USD setting the value as 10 will reduce credit by $10 (USD), setting 9.86 would reduce the credit by $9.86 (USD). The value will be reduced from any credit available.&lt;/p&gt;

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

Returns:



2815
2816
2817
2818
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 2815

def remove_credit_from_subscription(subscription_id, value, opts = {})
  data, _status_code, _headers = remove_credit_from_subscription_with_http_info(subscription_id, value, opts)
  return data
end

#remove_credit_from_subscription_with_http_info(subscription_id, value, opts = {}) ⇒ Array<(CreditNotePagedMetadata, Fixnum, Hash)>

Decrease the amount of credit available to the specified subscription. Credit&quot;,&quot;response&quot;:&quot;removeCreditForSubscription.html&quot;

Parameters:

  • subscription_id
  • value

    &lt;p&gt;Either a credit note ID or a currency value.&lt;/p&gt;&lt;p&gt;If a credit note ID is provided any remaining credit will be removed.&lt;/p&gt;&lt;p&gt;If a decimal is provided this value will be removed from any credit available to the subscription. For example if the subscription is in USD setting the value as 10 will reduce credit by $10 (USD), setting 9.86 would reduce the credit by $9.86 (USD). The value will be reduced from any credit available.&lt;/p&gt;

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

Returns:

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

    CreditNotePagedMetadata data, response status code and response headers



2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 2827

def remove_credit_from_subscription_with_http_info(subscription_id, value, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SubscriptionsApi.remove_credit_from_subscription ..."
  end
  # verify the required parameter 'subscription_id' is set
  fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.remove_credit_from_subscription" if subscription_id.nil?
  # verify the required parameter 'value' is set
  fail ArgumentError, "Missing the required parameter 'value' when calling SubscriptionsApi.remove_credit_from_subscription" if value.nil?
  # resource path
  local_var_path = "/subscriptions/{subscription-ID}/credit/{value}".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s).sub('{' + 'value' + '}', value.to_s)

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

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

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

#remove_payment_method_from_subscription(subscription_id, payment_method_id, opts = {}) ⇒ PaymentMethodPagedMetadata

Removes the specified payment method for the given subscription. payment-method","response":"removePaymentMethod.html","request":"removePaymentMethod.request.html"

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

Returns:



2879
2880
2881
2882
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 2879

def remove_payment_method_from_subscription(subscription_id, payment_method_id, opts = {})
  data, _status_code, _headers = remove_payment_method_from_subscription_with_http_info(subscription_id, payment_method_id, opts)
  return data
end

#remove_payment_method_from_subscription_with_http_info(subscription_id, payment_method_id, opts = {}) ⇒ Array<(PaymentMethodPagedMetadata, Fixnum, Hash)>

Removes the specified payment method for the given subscription. payment-method&quot;,&quot;response&quot;:&quot;removePaymentMethod.html&quot;,&quot;request&quot;:&quot;removePaymentMethod.request.html&quot;

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

Returns:

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

    PaymentMethodPagedMetadata data, response status code and response headers



2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 2891

def remove_payment_method_from_subscription_with_http_info(subscription_id, payment_method_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SubscriptionsApi.remove_payment_method_from_subscription ..."
  end
  # verify the required parameter 'subscription_id' is set
  fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.remove_payment_method_from_subscription" if subscription_id.nil?
  # verify the required parameter 'payment_method_id' is set
  fail ArgumentError, "Missing the required parameter 'payment_method_id' when calling SubscriptionsApi.remove_payment_method_from_subscription" if payment_method_id.nil?
  # resource path
  local_var_path = "/subscriptions/{subscription-ID}/payment-methods/{payment-method-ID}".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s).sub('{' + 'payment-method-ID' + '}', payment_method_id.to_s)

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

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

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

#remove_pricing_component_value_change_from_subscription(subscription_id, pricing_component, opts = {}) ⇒ PaymentMethodPagedMetadata

Discards from the subscription any scheduled changes in the value of the specified pricing-component. value changes","response":"removePricingComponentValueChange.html"

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

Returns:



2943
2944
2945
2946
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 2943

def remove_pricing_component_value_change_from_subscription(subscription_id, pricing_component, opts = {})
  data, _status_code, _headers = remove_pricing_component_value_change_from_subscription_with_http_info(subscription_id, pricing_component, opts)
  return data
end

#remove_pricing_component_value_change_from_subscription_with_http_info(subscription_id, pricing_component, opts = {}) ⇒ Array<(PaymentMethodPagedMetadata, Fixnum, Hash)>

Discards from the subscription any scheduled changes in the value of the specified pricing-component. value changes&quot;,&quot;response&quot;:&quot;removePricingComponentValueChange.html&quot;

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

Returns:

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

    PaymentMethodPagedMetadata data, response status code and response headers



2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 2955

def remove_pricing_component_value_change_from_subscription_with_http_info(subscription_id, pricing_component, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SubscriptionsApi.remove_pricing_component_value_change_from_subscription ..."
  end
  # verify the required parameter 'subscription_id' is set
  fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.remove_pricing_component_value_change_from_subscription" if subscription_id.nil?
  # verify the required parameter 'pricing_component' is set
  fail ArgumentError, "Missing the required parameter 'pricing_component' when calling SubscriptionsApi.remove_pricing_component_value_change_from_subscription" if pricing_component.nil?
  # resource path
  local_var_path = "/subscriptions/{subscription-ID}/values/{pricing-component}".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s).sub('{' + 'pricing-component' + '}', pricing_component.to_s)

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

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  local_header_content_type = ['text/plain', 'application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

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

#resume_subscription(subscription_id, request, opts = {}) ⇒ SubscriptionPagedMetadata

Resume the frozen subscription. Bfwd::SubscriptionsApi."nickname":"Resume","request":"resumeSubscriptionRequest.html","response":"resumeSubscription"nickname":"Resume","request":"resumeSubscriptionRequest.html","response":"resumeSubscription.html"

Parameters:

  • subscription_id

    ID of the subscription.

  • request

    The request

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

    the optional parameters

Returns:



3006
3007
3008
3009
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 3006

def resume_subscription(subscription_id, request, opts = {})
  data, _status_code, _headers = resume_subscription_with_http_info(subscription_id, request, opts)
  return data
end

#resume_subscription_with_http_info(subscription_id, request, opts = {}) ⇒ Array<(SubscriptionPagedMetadata, Fixnum, Hash)>

Resume the frozen subscription. Bfwd::SubscriptionsApi.&quot;nickname&quot;:&quot;Resume&quot;,&quot;request&quot;:&quot;resumeSubscriptionRequest.html&quot;,&quot;response&quot;:&quot;resumeSubscription&quot;nickname&quot;:&quot;Resume&quot;,&quot;request&quot;:&quot;resumeSubscriptionRequest.html&quot;,&quot;response&quot;:&quot;resumeSubscription.html&quot;

Parameters:

  • subscription_id

    ID of the subscription.

  • request

    The request

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

    the optional parameters

Returns:

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

    SubscriptionPagedMetadata data, response status code and response headers



3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 3017

def resume_subscription_with_http_info(subscription_id, request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SubscriptionsApi.resume_subscription ..."
  end
  # verify the required parameter 'subscription_id' is set
  fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.resume_subscription" if subscription_id.nil?
  # verify the required parameter 'request' is set
  fail ArgumentError, "Missing the required parameter 'request' when calling SubscriptionsApi.resume_subscription" if request.nil?
  # resource path
  local_var_path = "/subscriptions/{subscription-ID}/resume".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(request)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SubscriptionPagedMetadata')
  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

#revive_subscription(subscription_id, request, opts = {}) ⇒ SubscriptionPagedMetadata

Revives a cancelled subscription and returns it to its previous state subscription","request":"reviveSubscriptionRequest.html", "response":"reviveSubscription.html"

Parameters:

  • subscription_id
  • request

    The revive request

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

    the optional parameters

Returns:



3067
3068
3069
3070
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 3067

def revive_subscription(subscription_id, request, opts = {})
  data, _status_code, _headers = revive_subscription_with_http_info(subscription_id, request, opts)
  return data
end

#revive_subscription_with_http_info(subscription_id, request, opts = {}) ⇒ Array<(SubscriptionPagedMetadata, Fixnum, Hash)>

Revives a cancelled subscription and returns it to its previous state subscription&quot;,&quot;request&quot;:&quot;reviveSubscriptionRequest.html&quot;, &quot;response&quot;:&quot;reviveSubscription.html&quot;

Parameters:

  • subscription_id
  • request

    The revive request

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

    the optional parameters

Returns:

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

    SubscriptionPagedMetadata data, response status code and response headers



3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 3078

def revive_subscription_with_http_info(subscription_id, request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SubscriptionsApi.revive_subscription ..."
  end
  # verify the required parameter 'subscription_id' is set
  fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.revive_subscription" if subscription_id.nil?
  # verify the required parameter 'request' is set
  fail ArgumentError, "Missing the required parameter 'request' when calling SubscriptionsApi.revive_subscription" if request.nil?
  # resource path
  local_var_path = "/subscriptions/{subscription-ID}/revive".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(request)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SubscriptionPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#revive_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#set_metadata_for_subscription(metadata, subscription_id, opts = {}) ⇒ DynamicMetadata

Remove any existing metadata keys and create the provided data. on subscription","request":"setSubscriptionMetadataRequest.html","response":"setSubscriptionMetadataResponse.html"

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

Returns:



3129
3130
3131
3132
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 3129

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

#set_metadata_for_subscription_with_http_info(metadata, subscription_id, opts = {}) ⇒ Array<(DynamicMetadata, Fixnum, Hash)>

Remove any existing metadata keys and create the provided data. on subscription&quot;,&quot;request&quot;:&quot;setSubscriptionMetadataRequest.html&quot;,&quot;response&quot;:&quot;setSubscriptionMetadataResponse.html&quot;

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

Returns:

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

    DynamicMetadata data, response status code and response headers



3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 3141

def (, subscription_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SubscriptionsApi.set_metadata_for_subscription ..."
  end
  # verify the required parameter 'metadata' is set
  fail ArgumentError, "Missing the required parameter 'metadata' when calling SubscriptionsApi.set_metadata_for_subscription" if .nil?
  # verify the required parameter 'subscription_id' is set
  fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.set_metadata_for_subscription" if subscription_id.nil?
  # resource path
  local_var_path = "/subscriptions/{subscription-ID}/metadata".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)

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

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body()
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'DynamicMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#set_metadata_for_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#set_pricing_component_value_on_subscription(subscription_id, pricing_component_value, opts = {}) ⇒ PricingComponentValuePagedMetadata

Sets upon this subscription a new value for the specified pricing-component without performing an upgrade. values","request":"setPricingComponentValuesRequest.html","response":"setPricingComponentValues.html"

Parameters:

  • subscription_id

    ID of the subscription.

  • pricing_component_value

    The pricing-component-value request

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

    the optional parameters

Returns:



3192
3193
3194
3195
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 3192

def set_pricing_component_value_on_subscription(subscription_id, pricing_component_value, opts = {})
  data, _status_code, _headers = set_pricing_component_value_on_subscription_with_http_info(subscription_id, pricing_component_value, opts)
  return data
end

#set_pricing_component_value_on_subscription_batch_update(subscription_id, request, opts = {}) ⇒ UpdatePricingComponentValueResponsePagedMetadata

Upgrades/downgrades this subscription to some new value for the specified pricing-component. This endpoint can do synchronous (immediate) and asynchronous (delayed) updates. A synchronous update will generate a charge/credit for an UPGRADE or DOWNGRADE. An asynchronous update will generate an amendment scheduled for the end of the billing period. By default each update is considered synchronous, you can make them asynchronous setting ‘applyChangeNow’ to ‘false’. values","request":"setBatchPricingComponentValueRequest.html","response":"setBatchPricingComponentValue.html"

Parameters:

  • subscription_id

    ID of the subscription

  • request

    The batched update requests.

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

    the optional parameters

Returns:



3253
3254
3255
3256
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 3253

def set_pricing_component_value_on_subscription_batch_update(subscription_id, request, opts = {})
  data, _status_code, _headers = set_pricing_component_value_on_subscription_batch_update_with_http_info(subscription_id, request, opts)
  return data
end

#set_pricing_component_value_on_subscription_batch_update_with_http_info(subscription_id, request, opts = {}) ⇒ Array<(UpdatePricingComponentValueResponsePagedMetadata, Fixnum, Hash)>

Upgrades/downgrades this subscription to some new value for the specified pricing-component. This endpoint can do synchronous (immediate) and asynchronous (delayed) updates. A synchronous update will generate a charge/credit for an UPGRADE or DOWNGRADE. An asynchronous update will generate an amendment scheduled for the end of the billing period. By default each update is considered synchronous, you can make them asynchronous setting &#39;applyChangeNow&#39; to &#39;false&#39;. values&quot;,&quot;request&quot;:&quot;setBatchPricingComponentValueRequest.html&quot;,&quot;response&quot;:&quot;setBatchPricingComponentValue.html&quot;

Parameters:

  • subscription_id

    ID of the subscription

  • request

    The batched update requests.

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

    the optional parameters

Returns:



3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 3264

def set_pricing_component_value_on_subscription_batch_update_with_http_info(subscription_id, request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SubscriptionsApi.set_pricing_component_value_on_subscription_batch_update ..."
  end
  # verify the required parameter 'subscription_id' is set
  fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.set_pricing_component_value_on_subscription_batch_update" if subscription_id.nil?
  # verify the required parameter 'request' is set
  fail ArgumentError, "Missing the required parameter 'request' when calling SubscriptionsApi.set_pricing_component_value_on_subscription_batch_update" if request.nil?
  # resource path
  local_var_path = "/subscriptions/{subscription-ID}/values".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(request)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'UpdatePricingComponentValueResponsePagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#set_pricing_component_value_on_subscription_batch_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#set_pricing_component_value_on_subscription_v2(subscription_id, pricing_component, value, opts = {}) ⇒ PricingComponentValueResponsePagedMetadata

Upgrades/downgrades this subscription to some new value for the specified pricing-component. value","request":"setPricingComponentValueRequest.html","response":"setPricingComponentValue.html"

Parameters:

  • subscription_id
  • pricing_component

    Name or ID of the pricing-component.

  • value

    The pricing-component-value request

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

    the optional parameters

Returns:



3315
3316
3317
3318
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 3315

def set_pricing_component_value_on_subscription_v2(subscription_id, pricing_component, value, opts = {})
  data, _status_code, _headers = set_pricing_component_value_on_subscription_v2_with_http_info(subscription_id, pricing_component, value, opts)
  return data
end

#set_pricing_component_value_on_subscription_v2_with_http_info(subscription_id, pricing_component, value, opts = {}) ⇒ Array<(PricingComponentValueResponsePagedMetadata, Fixnum, Hash)>

Upgrades/downgrades this subscription to some new value for the specified pricing-component. value&quot;,&quot;request&quot;:&quot;setPricingComponentValueRequest.html&quot;,&quot;response&quot;:&quot;setPricingComponentValue.html&quot;

Parameters:

  • subscription_id
  • pricing_component

    Name or ID of the pricing-component.

  • value

    The pricing-component-value request

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

    the optional parameters

Returns:



3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 3327

def set_pricing_component_value_on_subscription_v2_with_http_info(subscription_id, pricing_component, value, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SubscriptionsApi.set_pricing_component_value_on_subscription_v2 ..."
  end
  # verify the required parameter 'subscription_id' is set
  fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.set_pricing_component_value_on_subscription_v2" if subscription_id.nil?
  # verify the required parameter 'pricing_component' is set
  fail ArgumentError, "Missing the required parameter 'pricing_component' when calling SubscriptionsApi.set_pricing_component_value_on_subscription_v2" if pricing_component.nil?
  # verify the required parameter 'value' is set
  fail ArgumentError, "Missing the required parameter 'value' when calling SubscriptionsApi.set_pricing_component_value_on_subscription_v2" if value.nil?
  # resource path
  local_var_path = "/subscriptions/{subscription-ID}/values/{pricing-component}".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s).sub('{' + 'pricing-component' + '}', pricing_component.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(value)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'PricingComponentValueResponsePagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#set_pricing_component_value_on_subscription_v2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#set_pricing_component_value_on_subscription_with_http_info(subscription_id, pricing_component_value, opts = {}) ⇒ Array<(PricingComponentValuePagedMetadata, Fixnum, Hash)>

Sets upon this subscription a new value for the specified pricing-component without performing an upgrade. values&quot;,&quot;request&quot;:&quot;setPricingComponentValuesRequest.html&quot;,&quot;response&quot;:&quot;setPricingComponentValues.html&quot;

Parameters:

  • subscription_id

    ID of the subscription.

  • pricing_component_value

    The pricing-component-value request

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

    the optional parameters

Returns:



3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 3203

def set_pricing_component_value_on_subscription_with_http_info(subscription_id, pricing_component_value, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SubscriptionsApi.set_pricing_component_value_on_subscription ..."
  end
  # verify the required parameter 'subscription_id' is set
  fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.set_pricing_component_value_on_subscription" if subscription_id.nil?
  # verify the required parameter 'pricing_component_value' is set
  fail ArgumentError, "Missing the required parameter 'pricing_component_value' when calling SubscriptionsApi.set_pricing_component_value_on_subscription" if pricing_component_value.nil?
  # resource path
  local_var_path = "/subscriptions/{subscription-ID}/pricing-component-values".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(pricing_component_value)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'PricingComponentValuePagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SubscriptionsApi#set_pricing_component_value_on_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_subscription(subscription, opts = {}) ⇒ SubscriptionPagedMetadata

Update a subscription. a subscription","request":"updateSubscriptionRequest.html","response":"updateSubscriptionResponse.html"

Parameters:

  • subscription

    The subscription object to be updated.

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

    the optional parameters

Returns:



3378
3379
3380
3381
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 3378

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

#update_subscription_v2(request, opts = {}) ⇒ SubscriptionPagedMetadata

Update a subscription (V2). subscription (V2)","response":"updateSubscriptionViaHelper.html","request":"updateSubscriptionViaHelper.request.html"

Parameters:

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

    the optional parameters

Returns:



3435
3436
3437
3438
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 3435

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

#update_subscription_v2_with_http_info(request, opts = {}) ⇒ Array<(SubscriptionPagedMetadata, Fixnum, Hash)>

Update a subscription (V2). subscription (V2)&quot;,&quot;response&quot;:&quot;updateSubscriptionViaHelper.html&quot;,&quot;request&quot;:&quot;updateSubscriptionViaHelper.request.html&quot;

Parameters:

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

    the optional parameters

Returns:

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

    SubscriptionPagedMetadata data, response status code and response headers



3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 3445

def update_subscription_v2_with_http_info(request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SubscriptionsApi.update_subscription_v2 ..."
  end
  # verify the required parameter 'request' is set
  fail ArgumentError, "Missing the required parameter 'request' when calling SubscriptionsApi.update_subscription_v2" if request.nil?
  # resource path
  local_var_path = "/subscriptions/update".sub('{format}','json')

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

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

#update_subscription_with_http_info(subscription, opts = {}) ⇒ Array<(SubscriptionPagedMetadata, Fixnum, Hash)>

Update a subscription. a subscription&quot;,&quot;request&quot;:&quot;updateSubscriptionRequest.html&quot;,&quot;response&quot;:&quot;updateSubscriptionResponse.html&quot;

Parameters:

  • subscription

    The subscription object to be updated.

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

    the optional parameters

Returns:

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

    SubscriptionPagedMetadata data, response status code and response headers



3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 3388

def update_subscription_with_http_info(subscription, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SubscriptionsApi.update_subscription ..."
  end
  # verify the required parameter 'subscription' is set
  fail ArgumentError, "Missing the required parameter 'subscription' when calling SubscriptionsApi.update_subscription" if subscription.nil?
  # resource path
  local_var_path = "/subscriptions".sub('{format}','json')

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['text/xml', 'application/xml', 'application/json; charset=utf-8']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(subscription)
  auth_names = []
  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 => 'SubscriptionPagedMetadata')
  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

#upsert_metadata_for_subscription(metadata, subscription_id, opts = {}) ⇒ DynamicMetadata

Update any existing metadata key-values and insert any new key-values, no keys will be removed. on subscription","request":"upsertSubscriptionMetadataRequest.html","response":"upsertSubscriptionMetadataResponse.html"

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

Returns:



3494
3495
3496
3497
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 3494

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

#upsert_metadata_for_subscription_with_http_info(metadata, subscription_id, opts = {}) ⇒ Array<(DynamicMetadata, Fixnum, Hash)>

Update any existing metadata key-values and insert any new key-values, no keys will be removed. on subscription&quot;,&quot;request&quot;:&quot;upsertSubscriptionMetadataRequest.html&quot;,&quot;response&quot;:&quot;upsertSubscriptionMetadataResponse.html&quot;

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :organizations (Array<String>)

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

Returns:

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

    DynamicMetadata data, response status code and response headers



3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
# File 'lib/bf_ruby2/api/subscriptions_api.rb', line 3506

def (, subscription_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SubscriptionsApi.upsert_metadata_for_subscription ..."
  end
  # verify the required parameter 'metadata' is set
  fail ArgumentError, "Missing the required parameter 'metadata' when calling SubscriptionsApi.upsert_metadata_for_subscription" if .nil?
  # verify the required parameter 'subscription_id' is set
  fail ArgumentError, "Missing the required parameter 'subscription_id' when calling SubscriptionsApi.upsert_metadata_for_subscription" if subscription_id.nil?
  # resource path
  local_var_path = "/subscriptions/{subscription-ID}/metadata".sub('{format}','json').sub('{' + 'subscription-ID' + '}', subscription_id.to_s)

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

  # header parameters
  header_params = {}

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

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json; charset=utf-8']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

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