maxio-advanced-billing-sdk 4.0.0 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +45 -45
- data/lib/advanced_billing/configuration.rb +2 -2
- data/lib/advanced_billing/controllers/advance_invoice_controller.rb +24 -24
- data/lib/advanced_billing/controllers/api_exports_controller.rb +57 -57
- data/lib/advanced_billing/controllers/base_controller.rb +10 -10
- data/lib/advanced_billing/controllers/billing_portal_controller.rb +33 -32
- data/lib/advanced_billing/controllers/component_price_points_controller.rb +60 -60
- data/lib/advanced_billing/controllers/components_controller.rb +110 -107
- data/lib/advanced_billing/controllers/coupons_controller.rb +89 -89
- data/lib/advanced_billing/controllers/custom_fields_controller.rb +76 -76
- data/lib/advanced_billing/controllers/customers_controller.rb +45 -41
- data/lib/advanced_billing/controllers/events_based_billing_segments_controller.rb +53 -53
- data/lib/advanced_billing/controllers/events_controller.rb +16 -15
- data/lib/advanced_billing/controllers/insights_controller.rb +17 -17
- data/lib/advanced_billing/controllers/invoices_controller.rb +99 -99
- data/lib/advanced_billing/controllers/offers_controller.rb +18 -15
- data/lib/advanced_billing/controllers/payment_profiles_controller.rb +107 -104
- data/lib/advanced_billing/controllers/product_families_controller.rb +26 -26
- data/lib/advanced_billing/controllers/product_price_points_controller.rb +62 -62
- data/lib/advanced_billing/controllers/products_controller.rb +37 -37
- data/lib/advanced_billing/controllers/proforma_invoices_controller.rb +61 -61
- data/lib/advanced_billing/controllers/reason_codes_controller.rb +35 -35
- data/lib/advanced_billing/controllers/referral_codes_controller.rb +9 -8
- data/lib/advanced_billing/controllers/sales_commissions_controller.rb +13 -13
- data/lib/advanced_billing/controllers/sites_controller.rb +11 -10
- data/lib/advanced_billing/controllers/subscription_components_controller.rb +170 -161
- data/lib/advanced_billing/controllers/subscription_group_invoice_account_controller.rb +23 -23
- data/lib/advanced_billing/controllers/subscription_group_status_controller.rb +21 -21
- data/lib/advanced_billing/controllers/subscription_groups_controller.rb +54 -54
- data/lib/advanced_billing/controllers/subscription_invoice_account_controller.rb +37 -37
- data/lib/advanced_billing/controllers/subscription_notes_controller.rb +20 -16
- data/lib/advanced_billing/controllers/subscription_products_controller.rb +20 -18
- data/lib/advanced_billing/controllers/subscription_status_controller.rb +74 -74
- data/lib/advanced_billing/controllers/subscriptions_controller.rb +163 -160
- data/lib/advanced_billing/controllers/webhooks_controller.rb +45 -44
- data/lib/advanced_billing/exceptions/component_allocation_error_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/component_price_point_error_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/customer_error_response_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/error_array_map_response_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/error_list_response_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/error_string_map_response_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/event_based_billing_list_segments_errors_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/event_based_billing_segment_errors_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/event_based_billing_segment_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/product_price_point_error_response_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/proforma_bad_request_error_response_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/refund_prepayment_base_errors_response_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/single_error_response_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/single_string_error_response_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/subscription_add_coupon_error_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/subscription_component_allocation_error_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/subscription_group_create_error_response_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/subscription_group_signup_error_response_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/subscription_group_update_error_response_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/subscription_remove_coupon_errors_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/subscriptions_mrr_error_response_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/too_many_management_link_requests_error_exception.rb +15 -15
- data/lib/advanced_billing/models/activate_event_based_component.rb +84 -0
- data/lib/advanced_billing/models/{current_vault.rb → all_vaults.rb} +28 -7
- data/lib/advanced_billing/models/allocation.rb +1 -0
- data/lib/advanced_billing/models/allocation_preview_item.rb +1 -0
- data/lib/advanced_billing/models/apple_pay_payment_profile.rb +232 -0
- data/lib/advanced_billing/models/apple_pay_vault.rb +20 -0
- data/lib/advanced_billing/models/bank_account_attributes.rb +2 -0
- data/lib/advanced_billing/models/bank_account_payment_profile.rb +25 -20
- data/lib/advanced_billing/models/bank_account_vault.rb +19 -9
- data/lib/advanced_billing/models/change_invoice_status_event_data.rb +6 -6
- data/lib/advanced_billing/models/component.rb +1 -0
- data/lib/advanced_billing/models/component_custom_price.rb +33 -14
- data/lib/advanced_billing/models/component_price_point_item.rb +3 -1
- data/lib/advanced_billing/models/create_component_price_point.rb +3 -1
- data/lib/advanced_billing/models/create_customer.rb +11 -1
- data/lib/advanced_billing/models/create_metafield.rb +2 -1
- data/lib/advanced_billing/models/create_or_update_product.rb +7 -4
- data/lib/advanced_billing/models/create_payment_profile.rb +1 -1
- data/lib/advanced_billing/models/create_prepaid_usage_component_price_point.rb +6 -5
- data/lib/advanced_billing/models/create_product_price_point.rb +5 -3
- data/lib/advanced_billing/models/create_subscription.rb +27 -25
- data/lib/advanced_billing/models/credit_card_payment_profile.rb +17 -16
- data/lib/advanced_billing/models/credit_card_vault.rb +117 -0
- data/lib/advanced_billing/models/credit_note.rb +2 -2
- data/lib/advanced_billing/models/customer.rb +11 -1
- data/lib/advanced_billing/models/customer_attributes.rb +12 -1
- data/lib/advanced_billing/models/ebb_component.rb +1 -0
- data/lib/advanced_billing/models/{extended_interval_unit.rb → expiration_interval_unit.rb} +4 -4
- data/lib/advanced_billing/models/full_subscription_group_response.rb +65 -50
- data/lib/advanced_billing/models/get_one_time_token_payment_profile.rb +1 -1
- data/lib/advanced_billing/models/invoice.rb +19 -9
- data/lib/advanced_billing/models/invoice_consolidation_level.rb +2 -2
- data/lib/advanced_billing/models/invoice_refund.rb +13 -1
- data/lib/advanced_billing/models/invoice_status.rb +2 -2
- data/lib/advanced_billing/models/invoice_tax.rb +29 -0
- data/lib/advanced_billing/models/invoice_tax_component_breakout.rb +101 -1
- data/lib/advanced_billing/models/issue_invoice_event_data.rb +6 -6
- data/lib/advanced_billing/models/metered_component.rb +4 -3
- data/lib/advanced_billing/models/offer_item.rb +3 -1
- data/lib/advanced_billing/models/on_off_component.rb +3 -2
- data/lib/advanced_billing/models/paid_invoice.rb +2 -2
- data/lib/advanced_billing/models/pay_pal_vault.rb +29 -0
- data/lib/advanced_billing/models/payment_profile_attributes.rb +5 -5
- data/lib/advanced_billing/models/payment_profile_response.rb +3 -3
- data/lib/advanced_billing/models/payment_type.rb +4 -1
- data/lib/advanced_billing/models/paypal_payment_profile.rb +242 -0
- data/lib/advanced_billing/models/prepaid_usage_component.rb +5 -4
- data/lib/advanced_billing/models/product.rb +2 -2
- data/lib/advanced_billing/models/product_price_point.rb +2 -2
- data/lib/advanced_billing/models/proforma_invoice.rb +6 -6
- data/lib/advanced_billing/models/quantity_based_component.rb +4 -3
- data/lib/advanced_billing/models/refund_invoice_event_data.rb +4 -4
- data/lib/advanced_billing/models/resent_invitation.rb +36 -0
- data/lib/advanced_billing/models/subscription.rb +13 -10
- data/lib/advanced_billing/models/subscription_component.rb +1 -0
- data/lib/advanced_billing/models/subscription_component_subscription.rb +26 -20
- data/lib/advanced_billing/models/subscription_custom_price.rb +5 -2
- data/lib/advanced_billing/models/subscription_group_bank_account.rb +2 -0
- data/lib/advanced_billing/models/subscription_group_credit_card.rb +1 -1
- data/lib/advanced_billing/models/subscription_group_signup_response.rb +39 -30
- data/lib/advanced_billing/models/subscription_state.rb +30 -30
- data/lib/advanced_billing/models/tax_configuration.rb +1 -2
- data/lib/advanced_billing/models/update_component_price_point.rb +3 -1
- data/lib/advanced_billing/models/update_customer.rb +12 -1
- data/lib/advanced_billing/models/update_payment_profile.rb +1 -1
- data/lib/advanced_billing/utilities/file_wrapper.rb +9 -9
- data/lib/advanced_billing/utilities/union_type_lookup.rb +17 -3
- data/lib/advanced_billing.rb +10 -4
- metadata +16 -10
@@ -10,15 +10,15 @@ module AdvancedBilling
|
|
10
10
|
# apply to all new subscriptions going forward - existing subscriptions will
|
11
11
|
# remain on their current price point.
|
12
12
|
# See [Price Points
|
13
|
-
# Documentation](https://
|
14
|
-
#
|
13
|
+
# Documentation](https://maxio.zendesk.com/hc/en-us/articles/24261191737101-
|
14
|
+
# Price-Points-Components) for more information on price points and moving
|
15
15
|
# subscriptions between price points.
|
16
16
|
# Note: Custom price points are not able to be set as the default for a
|
17
17
|
# component.
|
18
|
-
# @param [Integer] component_id Required parameter: The
|
19
|
-
# component to which the price point belongs
|
20
|
-
# @param [Integer] price_point_id Required parameter: The
|
21
|
-
# price point
|
18
|
+
# @param [Integer] component_id Required parameter: The Advanced Billing id
|
19
|
+
# of the component to which the price point belongs
|
20
|
+
# @param [Integer] price_point_id Required parameter: The Advanced Billing
|
21
|
+
# id of the price point
|
22
22
|
# @return [ComponentResponse] response from the API call
|
23
23
|
def promote_component_price_point_to_default(component_id,
|
24
24
|
price_point_id)
|
@@ -35,15 +35,15 @@ module AdvancedBilling
|
|
35
35
|
.header_param(new_parameter('application/json', key: 'accept'))
|
36
36
|
.auth(Single.new('BasicAuth')))
|
37
37
|
.response(new_response_handler
|
38
|
-
|
39
|
-
|
38
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
39
|
+
.deserialize_into(ComponentResponse.method(:from_hash)))
|
40
40
|
.execute
|
41
41
|
end
|
42
42
|
|
43
43
|
# This endpoint can be used to create a new price point for an existing
|
44
44
|
# component.
|
45
|
-
# @param [Integer] component_id Required parameter: The
|
46
|
-
# component
|
45
|
+
# @param [Integer] component_id Required parameter: The Advanced Billing id
|
46
|
+
# of the component
|
47
47
|
# @param [CreateComponentPricePointRequest] body Optional parameter:
|
48
48
|
# Example:
|
49
49
|
# @return [ComponentPricePointResponse] response from the API call
|
@@ -62,8 +62,8 @@ module AdvancedBilling
|
|
62
62
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
63
63
|
.auth(Single.new('BasicAuth')))
|
64
64
|
.response(new_response_handler
|
65
|
-
|
66
|
-
|
65
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
66
|
+
.deserialize_into(ComponentPricePointResponse.method(:from_hash)))
|
67
67
|
.execute
|
68
68
|
end
|
69
69
|
|
@@ -78,8 +78,8 @@ module AdvancedBilling
|
|
78
78
|
# If the price point is set to `use_site_exchange_rate: true`, it will
|
79
79
|
# return pricing based on the current exchange rate. If the flag is set to
|
80
80
|
# false, it will return all of the defined prices for each currency.
|
81
|
-
# @param [Integer] component_id Required parameter: The
|
82
|
-
# component
|
81
|
+
# @param [Integer] component_id Required parameter: The Advanced Billing id
|
82
|
+
# of the component
|
83
83
|
# @param [TrueClass | FalseClass] currency_prices Optional parameter:
|
84
84
|
# Include an array of currency price data
|
85
85
|
# @param [Integer] page Optional parameter: Result records are organized in
|
@@ -112,15 +112,15 @@ module AdvancedBilling
|
|
112
112
|
.auth(Single.new('BasicAuth'))
|
113
113
|
.array_serialization_format(ArraySerializationFormat::CSV))
|
114
114
|
.response(new_response_handler
|
115
|
-
|
116
|
-
|
115
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
116
|
+
.deserialize_into(ComponentPricePointsResponse.method(:from_hash)))
|
117
117
|
.execute
|
118
118
|
end
|
119
119
|
|
120
120
|
# Use this endpoint to create multiple component price points in one
|
121
121
|
# request.
|
122
|
-
# @param [String] component_id Required parameter: The
|
123
|
-
# component for which you want to fetch price points.
|
122
|
+
# @param [String] component_id Required parameter: The Advanced Billing id
|
123
|
+
# of the component for which you want to fetch price points.
|
124
124
|
# @param [CreateComponentPricePointsRequest] body Optional parameter:
|
125
125
|
# Example:
|
126
126
|
# @return [ComponentPricePointsResponse] response from the API call
|
@@ -139,8 +139,8 @@ module AdvancedBilling
|
|
139
139
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
140
140
|
.auth(Single.new('BasicAuth')))
|
141
141
|
.response(new_response_handler
|
142
|
-
|
143
|
-
|
142
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
143
|
+
.deserialize_into(ComponentPricePointsResponse.method(:from_hash)))
|
144
144
|
.execute
|
145
145
|
end
|
146
146
|
|
@@ -190,12 +190,12 @@ module AdvancedBilling
|
|
190
190
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
191
191
|
.auth(Single.new('BasicAuth')))
|
192
192
|
.response(new_response_handler
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
193
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
194
|
+
.deserialize_into(ComponentPricePointResponse.method(:from_hash))
|
195
|
+
.local_error_template('422',
|
196
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
197
|
+
' Response: \'{$response.body}\'.',
|
198
|
+
ErrorArrayMapResponseException))
|
199
199
|
.execute
|
200
200
|
end
|
201
201
|
|
@@ -234,8 +234,8 @@ module AdvancedBilling
|
|
234
234
|
.header_param(new_parameter('application/json', key: 'accept'))
|
235
235
|
.auth(Single.new('BasicAuth')))
|
236
236
|
.response(new_response_handler
|
237
|
-
|
238
|
-
|
237
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
238
|
+
.deserialize_into(ComponentPricePointResponse.method(:from_hash)))
|
239
239
|
.execute
|
240
240
|
end
|
241
241
|
|
@@ -274,20 +274,20 @@ module AdvancedBilling
|
|
274
274
|
.header_param(new_parameter('application/json', key: 'accept'))
|
275
275
|
.auth(Single.new('BasicAuth')))
|
276
276
|
.response(new_response_handler
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
277
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
278
|
+
.deserialize_into(ComponentPricePointResponse.method(:from_hash))
|
279
|
+
.local_error_template('422',
|
280
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
281
|
+
' Response: \'{$response.body}\'.',
|
282
|
+
ErrorListResponseException))
|
283
283
|
.execute
|
284
284
|
end
|
285
285
|
|
286
286
|
# Use this endpoint to unarchive a component price point.
|
287
|
-
# @param [Integer] component_id Required parameter: The
|
288
|
-
# component to which the price point belongs
|
289
|
-
# @param [Integer] price_point_id Required parameter: The
|
290
|
-
# price point
|
287
|
+
# @param [Integer] component_id Required parameter: The Advanced Billing id
|
288
|
+
# of the component to which the price point belongs
|
289
|
+
# @param [Integer] price_point_id Required parameter: The Advanced Billing
|
290
|
+
# id of the price point
|
291
291
|
# @return [ComponentPricePointResponse] response from the API call
|
292
292
|
def unarchive_component_price_point(component_id,
|
293
293
|
price_point_id)
|
@@ -304,8 +304,8 @@ module AdvancedBilling
|
|
304
304
|
.header_param(new_parameter('application/json', key: 'accept'))
|
305
305
|
.auth(Single.new('BasicAuth')))
|
306
306
|
.response(new_response_handler
|
307
|
-
|
308
|
-
|
307
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
308
|
+
.deserialize_into(ComponentPricePointResponse.method(:from_hash)))
|
309
309
|
.execute
|
310
310
|
end
|
311
311
|
|
@@ -316,8 +316,8 @@ module AdvancedBilling
|
|
316
316
|
# point, there should be a matching price level created in the given
|
317
317
|
# currency.
|
318
318
|
# Note: Currency Prices are not able to be created for custom price points.
|
319
|
-
# @param [Integer] price_point_id Required parameter: The
|
320
|
-
# price point
|
319
|
+
# @param [Integer] price_point_id Required parameter: The Advanced Billing
|
320
|
+
# id of the price point
|
321
321
|
# @param [CreateCurrencyPricesRequest] body Optional parameter: Example:
|
322
322
|
# @return [ComponentCurrencyPricesResponse] response from the API call
|
323
323
|
def create_currency_prices(price_point_id,
|
@@ -335,19 +335,19 @@ module AdvancedBilling
|
|
335
335
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
336
336
|
.auth(Single.new('BasicAuth')))
|
337
337
|
.response(new_response_handler
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
338
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
339
|
+
.deserialize_into(ComponentCurrencyPricesResponse.method(:from_hash))
|
340
|
+
.local_error('422',
|
341
|
+
'Unprocessable Entity (WebDAV)',
|
342
|
+
ErrorArrayMapResponseException))
|
343
343
|
.execute
|
344
344
|
end
|
345
345
|
|
346
346
|
# This endpoint allows you to update currency prices for a given currency
|
347
347
|
# that has been defined on the site level in your settings.
|
348
348
|
# Note: Currency Prices are not able to be updated for custom price points.
|
349
|
-
# @param [Integer] price_point_id Required parameter: The
|
350
|
-
# price point
|
349
|
+
# @param [Integer] price_point_id Required parameter: The Advanced Billing
|
350
|
+
# id of the price point
|
351
351
|
# @param [UpdateCurrencyPricesRequest] body Optional parameter: Example:
|
352
352
|
# @return [ComponentCurrencyPricesResponse] response from the API call
|
353
353
|
def update_currency_prices(price_point_id,
|
@@ -365,11 +365,11 @@ module AdvancedBilling
|
|
365
365
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
366
366
|
.auth(Single.new('BasicAuth')))
|
367
367
|
.response(new_response_handler
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
368
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
369
|
+
.deserialize_into(ComponentCurrencyPricesResponse.method(:from_hash))
|
370
|
+
.local_error('422',
|
371
|
+
'Unprocessable Entity (WebDAV)',
|
372
|
+
ErrorArrayMapResponseException))
|
373
373
|
.execute
|
374
374
|
end
|
375
375
|
|
@@ -408,12 +408,12 @@ module AdvancedBilling
|
|
408
408
|
.auth(Single.new('BasicAuth'))
|
409
409
|
.array_serialization_format(ArraySerializationFormat::CSV))
|
410
410
|
.response(new_response_handler
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
411
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
412
|
+
.deserialize_into(ListComponentsPricePointsResponse.method(:from_hash))
|
413
|
+
.local_error_template('422',
|
414
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
415
|
+
' Response: \'{$response.body}\'.',
|
416
|
+
ErrorListResponseException))
|
417
417
|
.execute
|
418
418
|
end
|
419
419
|
end
|
@@ -18,10 +18,10 @@ module AdvancedBilling
|
|
18
18
|
# want to bill for a quantity of something that does not change unless you
|
19
19
|
# change it, then you want quantity components, instead.
|
20
20
|
# For more information on components, please see our documentation
|
21
|
-
# [here](https://maxio
|
22
|
-
# .
|
23
|
-
# @param [
|
24
|
-
#
|
21
|
+
# [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Componen
|
22
|
+
# ts-Overview).
|
23
|
+
# @param [String] product_family_id Required parameter: Either the product
|
24
|
+
# family's id or its handle prefixed with `handle:`
|
25
25
|
# @param [CreateMeteredComponent] body Optional parameter: Example:
|
26
26
|
# @return [ComponentResponse] response from the API call
|
27
27
|
def create_metered_component(product_family_id,
|
@@ -39,15 +39,15 @@ module AdvancedBilling
|
|
39
39
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
40
40
|
.auth(Single.new('BasicAuth')))
|
41
41
|
.response(new_response_handler
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
42
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
43
|
+
.deserialize_into(ComponentResponse.method(:from_hash))
|
44
|
+
.local_error_template('404',
|
45
|
+
'Not Found:\'{$response.body}\'',
|
46
|
+
APIException)
|
47
|
+
.local_error_template('422',
|
48
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
49
|
+
' Response: \'{$response.body}\'.',
|
50
|
+
ErrorListResponseException))
|
51
51
|
.execute
|
52
52
|
end
|
53
53
|
|
@@ -67,10 +67,10 @@ module AdvancedBilling
|
|
67
67
|
# The allocated quantity for one-time quantity-based components immediately
|
68
68
|
# gets reset back to zero after the allocation is made.
|
69
69
|
# For more information on components, please see our documentation
|
70
|
-
# [here](https://maxio
|
71
|
-
# .
|
72
|
-
# @param [
|
73
|
-
#
|
70
|
+
# [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Componen
|
71
|
+
# ts-Overview).
|
72
|
+
# @param [String] product_family_id Required parameter: Either the product
|
73
|
+
# family's id or its handle prefixed with `handle:`
|
74
74
|
# @param [CreateQuantityBasedComponent] body Optional parameter: Example:
|
75
75
|
# @return [ComponentResponse] response from the API call
|
76
76
|
def create_quantity_based_component(product_family_id,
|
@@ -88,15 +88,15 @@ module AdvancedBilling
|
|
88
88
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
89
89
|
.auth(Single.new('BasicAuth')))
|
90
90
|
.response(new_response_handler
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
91
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
92
|
+
.deserialize_into(ComponentResponse.method(:from_hash))
|
93
|
+
.local_error_template('404',
|
94
|
+
'Not Found:\'{$response.body}\'',
|
95
|
+
APIException)
|
96
|
+
.local_error_template('422',
|
97
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
98
|
+
' Response: \'{$response.body}\'.',
|
99
|
+
ErrorListResponseException))
|
100
100
|
.execute
|
101
101
|
end
|
102
102
|
|
@@ -106,10 +106,10 @@ module AdvancedBilling
|
|
106
106
|
# On/off components are used for any flat fee, recurring add on (think
|
107
107
|
# $99/month for tech support or a flat add on shipping fee).
|
108
108
|
# For more information on components, please see our documentation
|
109
|
-
# [here](https://maxio
|
110
|
-
# .
|
111
|
-
# @param [
|
112
|
-
#
|
109
|
+
# [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Componen
|
110
|
+
# ts-Overview).
|
111
|
+
# @param [String] product_family_id Required parameter: Either the product
|
112
|
+
# family's id or its handle prefixed with `handle:`
|
113
113
|
# @param [CreateOnOffComponent] body Optional parameter: Example:
|
114
114
|
# @return [ComponentResponse] response from the API call
|
115
115
|
def create_on_off_component(product_family_id,
|
@@ -127,15 +127,15 @@ module AdvancedBilling
|
|
127
127
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
128
128
|
.auth(Single.new('BasicAuth')))
|
129
129
|
.response(new_response_handler
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
130
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
131
|
+
.deserialize_into(ComponentResponse.method(:from_hash))
|
132
|
+
.local_error_template('404',
|
133
|
+
'Not Found:\'{$response.body}\'',
|
134
|
+
APIException)
|
135
|
+
.local_error_template('422',
|
136
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
137
|
+
' Response: \'{$response.body}\'.',
|
138
|
+
ErrorListResponseException))
|
139
139
|
.execute
|
140
140
|
end
|
141
141
|
|
@@ -149,10 +149,10 @@ module AdvancedBilling
|
|
149
149
|
# the time of purchase, and we subsequently keep track of the usage against
|
150
150
|
# the amount purchased.
|
151
151
|
# For more information on components, please see our documentation
|
152
|
-
# [here](https://maxio
|
153
|
-
# .
|
154
|
-
# @param [
|
155
|
-
#
|
152
|
+
# [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Componen
|
153
|
+
# ts-Overview).
|
154
|
+
# @param [String] product_family_id Required parameter: Either the product
|
155
|
+
# family's id or its handle prefixed with `handle:`
|
156
156
|
# @param [CreatePrepaidComponent] body Optional parameter: Example:
|
157
157
|
# @return [ComponentResponse] response from the API call
|
158
158
|
def create_prepaid_usage_component(product_family_id,
|
@@ -170,15 +170,15 @@ module AdvancedBilling
|
|
170
170
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
171
171
|
.auth(Single.new('BasicAuth')))
|
172
172
|
.response(new_response_handler
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
173
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
174
|
+
.deserialize_into(ComponentResponse.method(:from_hash))
|
175
|
+
.local_error_template('404',
|
176
|
+
'Not Found:\'{$response.body}\'',
|
177
|
+
APIException)
|
178
|
+
.local_error_template('422',
|
179
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
180
|
+
' Response: \'{$response.body}\'.',
|
181
|
+
ErrorListResponseException))
|
182
182
|
.execute
|
183
183
|
end
|
184
184
|
|
@@ -195,10 +195,10 @@ module AdvancedBilling
|
|
195
195
|
# with metered components), the usage is derived from analysis of your
|
196
196
|
# events.
|
197
197
|
# For more information on components, please see our documentation
|
198
|
-
# [here](https://maxio
|
199
|
-
# .
|
200
|
-
# @param [
|
201
|
-
#
|
198
|
+
# [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Componen
|
199
|
+
# ts-Overview).
|
200
|
+
# @param [String] product_family_id Required parameter: Either the product
|
201
|
+
# family's id or its handle prefixed with `handle:`
|
202
202
|
# @param [CreateEBBComponent] body Optional parameter: Example:
|
203
203
|
# @return [ComponentResponse] response from the API call
|
204
204
|
def create_event_based_component(product_family_id,
|
@@ -216,15 +216,15 @@ module AdvancedBilling
|
|
216
216
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
217
217
|
.auth(Single.new('BasicAuth')))
|
218
218
|
.response(new_response_handler
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
219
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
220
|
+
.deserialize_into(ComponentResponse.method(:from_hash))
|
221
|
+
.local_error_template('404',
|
222
|
+
'Not Found:\'{$response.body}\'',
|
223
|
+
APIException)
|
224
|
+
.local_error_template('422',
|
225
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
226
|
+
' Response: \'{$response.body}\'.',
|
227
|
+
ErrorListResponseException))
|
228
228
|
.execute
|
229
229
|
end
|
230
230
|
|
@@ -244,8 +244,8 @@ module AdvancedBilling
|
|
244
244
|
.header_param(new_parameter('application/json', key: 'accept'))
|
245
245
|
.auth(Single.new('BasicAuth')))
|
246
246
|
.response(new_response_handler
|
247
|
-
|
248
|
-
|
247
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
248
|
+
.deserialize_into(ComponentResponse.method(:from_hash)))
|
249
249
|
.execute
|
250
250
|
end
|
251
251
|
|
@@ -253,10 +253,11 @@ module AdvancedBilling
|
|
253
253
|
# product family.
|
254
254
|
# You may read the component by either the component's id or handle. When
|
255
255
|
# using the handle, it must be prefixed with `handle:`.
|
256
|
-
# @param [Integer] product_family_id Required parameter: The
|
257
|
-
# the product family to which the component belongs
|
258
|
-
# @param [String] component_id Required parameter: Either the
|
259
|
-
# the component or the handle for the component prefixed with
|
256
|
+
# @param [Integer] product_family_id Required parameter: The Advanced
|
257
|
+
# Billing id of the product family to which the component belongs
|
258
|
+
# @param [String] component_id Required parameter: Either the Advanced
|
259
|
+
# Billing id of the component or the handle for the component prefixed with
|
260
|
+
# `handle:`
|
260
261
|
# @return [ComponentResponse] response from the API call
|
261
262
|
def read_component(product_family_id,
|
262
263
|
component_id)
|
@@ -273,18 +274,19 @@ module AdvancedBilling
|
|
273
274
|
.header_param(new_parameter('application/json', key: 'accept'))
|
274
275
|
.auth(Single.new('BasicAuth')))
|
275
276
|
.response(new_response_handler
|
276
|
-
|
277
|
-
|
277
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
278
|
+
.deserialize_into(ComponentResponse.method(:from_hash)))
|
278
279
|
.execute
|
279
280
|
end
|
280
281
|
|
281
282
|
# This request will update a component from a specific product family.
|
282
283
|
# You may read the component by either the component's id or handle. When
|
283
284
|
# using the handle, it must be prefixed with `handle:`.
|
284
|
-
# @param [Integer] product_family_id Required parameter: The
|
285
|
-
# the product family to which the component belongs
|
286
|
-
# @param [String] component_id Required parameter: Either the
|
287
|
-
# the component or the handle for the component prefixed with
|
285
|
+
# @param [Integer] product_family_id Required parameter: The Advanced
|
286
|
+
# Billing id of the product family to which the component belongs
|
287
|
+
# @param [String] component_id Required parameter: Either the Advanced
|
288
|
+
# Billing id of the component or the handle for the component prefixed with
|
289
|
+
# `handle:`
|
288
290
|
# @param [UpdateComponentRequest] body Optional parameter: Example:
|
289
291
|
# @return [ComponentResponse] response from the API call
|
290
292
|
def update_product_family_component(product_family_id,
|
@@ -306,22 +308,23 @@ module AdvancedBilling
|
|
306
308
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
307
309
|
.auth(Single.new('BasicAuth')))
|
308
310
|
.response(new_response_handler
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
311
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
312
|
+
.deserialize_into(ComponentResponse.method(:from_hash))
|
313
|
+
.local_error_template('422',
|
314
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
315
|
+
' Response: \'{$response.body}\'.',
|
316
|
+
ErrorListResponseException))
|
315
317
|
.execute
|
316
318
|
end
|
317
319
|
|
318
320
|
# Sending a DELETE request to this endpoint will archive the component. All
|
319
321
|
# current subscribers will be unffected; their subscription/purchase will
|
320
322
|
# continue to be charged as usual.
|
321
|
-
# @param [Integer] product_family_id Required parameter: The
|
322
|
-
# the product family to which the component belongs
|
323
|
-
# @param [String] component_id Required parameter: Either the
|
324
|
-
# the component or the handle for the component prefixed with
|
323
|
+
# @param [Integer] product_family_id Required parameter: The Advanced
|
324
|
+
# Billing id of the product family to which the component belongs
|
325
|
+
# @param [String] component_id Required parameter: Either the Advanced
|
326
|
+
# Billing id of the component or the handle for the component prefixed with
|
327
|
+
# `handle:`
|
325
328
|
# @return [Component] response from the API call
|
326
329
|
def archive_component(product_family_id,
|
327
330
|
component_id)
|
@@ -338,12 +341,12 @@ module AdvancedBilling
|
|
338
341
|
.header_param(new_parameter('application/json', key: 'accept'))
|
339
342
|
.auth(Single.new('BasicAuth')))
|
340
343
|
.response(new_response_handler
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
344
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
345
|
+
.deserialize_into(Component.method(:from_hash))
|
346
|
+
.local_error_template('422',
|
347
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
348
|
+
' Response: \'{$response.body}\'.',
|
349
|
+
ErrorListResponseException))
|
347
350
|
.execute
|
348
351
|
end
|
349
352
|
|
@@ -403,9 +406,9 @@ module AdvancedBilling
|
|
403
406
|
.auth(Single.new('BasicAuth'))
|
404
407
|
.array_serialization_format(ArraySerializationFormat::CSV))
|
405
408
|
.response(new_response_handler
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
410
|
+
.deserialize_into(ComponentResponse.method(:from_hash))
|
411
|
+
.is_response_array(true))
|
409
412
|
.execute
|
410
413
|
end
|
411
414
|
|
@@ -431,19 +434,19 @@ module AdvancedBilling
|
|
431
434
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
432
435
|
.auth(Single.new('BasicAuth')))
|
433
436
|
.response(new_response_handler
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
437
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
438
|
+
.deserialize_into(ComponentResponse.method(:from_hash))
|
439
|
+
.local_error_template('422',
|
440
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
441
|
+
' Response: \'{$response.body}\'.',
|
442
|
+
ErrorListResponseException))
|
440
443
|
.execute
|
441
444
|
end
|
442
445
|
|
443
446
|
# This request will return a list of components for a particular product
|
444
447
|
# family.
|
445
|
-
# @param [Integer] product_family_id Required parameter: The
|
446
|
-
# the product family
|
448
|
+
# @param [Integer] product_family_id Required parameter: The Advanced
|
449
|
+
# Billing id of the product family
|
447
450
|
# @param [TrueClass | FalseClass] include_archived Optional parameter:
|
448
451
|
# Include archived items.
|
449
452
|
# @param [Integer] page Optional parameter: Result records are organized in
|
@@ -503,9 +506,9 @@ module AdvancedBilling
|
|
503
506
|
.auth(Single.new('BasicAuth'))
|
504
507
|
.array_serialization_format(ArraySerializationFormat::CSV))
|
505
508
|
.response(new_response_handler
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
510
|
+
.deserialize_into(ComponentResponse.method(:from_hash))
|
511
|
+
.is_response_array(true))
|
509
512
|
.execute
|
510
513
|
end
|
511
514
|
end
|