maxio-advanced-billing-sdk 4.0.0 → 5.1.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 +27 -27
- data/lib/advanced_billing/controllers/api_exports_controller.rb +66 -66
- data/lib/advanced_billing/controllers/base_controller.rb +10 -10
- data/lib/advanced_billing/controllers/billing_portal_controller.rb +37 -36
- data/lib/advanced_billing/controllers/component_price_points_controller.rb +71 -71
- data/lib/advanced_billing/controllers/components_controller.rb +122 -119
- data/lib/advanced_billing/controllers/coupons_controller.rb +103 -103
- data/lib/advanced_billing/controllers/custom_fields_controller.rb +85 -85
- data/lib/advanced_billing/controllers/customers_controller.rb +52 -48
- data/lib/advanced_billing/controllers/events_based_billing_segments_controller.rb +59 -59
- data/lib/advanced_billing/controllers/events_controller.rb +19 -18
- data/lib/advanced_billing/controllers/insights_controller.rb +21 -21
- data/lib/advanced_billing/controllers/invoices_controller.rb +116 -116
- data/lib/advanced_billing/controllers/offers_controller.rb +23 -20
- data/lib/advanced_billing/controllers/payment_profiles_controller.rb +119 -116
- data/lib/advanced_billing/controllers/product_families_controller.rb +30 -30
- data/lib/advanced_billing/controllers/product_price_points_controller.rb +73 -73
- data/lib/advanced_billing/controllers/products_controller.rb +43 -43
- data/lib/advanced_billing/controllers/proforma_invoices_controller.rb +70 -70
- data/lib/advanced_billing/controllers/reason_codes_controller.rb +40 -40
- data/lib/advanced_billing/controllers/referral_codes_controller.rb +10 -9
- data/lib/advanced_billing/controllers/sales_commissions_controller.rb +16 -16
- data/lib/advanced_billing/controllers/sites_controller.rb +14 -13
- data/lib/advanced_billing/controllers/subscription_components_controller.rb +187 -178
- data/lib/advanced_billing/controllers/subscription_group_invoice_account_controller.rb +27 -27
- data/lib/advanced_billing/controllers/subscription_group_status_controller.rb +25 -25
- data/lib/advanced_billing/controllers/subscription_groups_controller.rb +63 -63
- data/lib/advanced_billing/controllers/subscription_invoice_account_controller.rb +43 -43
- data/lib/advanced_billing/controllers/subscription_notes_controller.rb +25 -21
- data/lib/advanced_billing/controllers/subscription_products_controller.rb +22 -20
- data/lib/advanced_billing/controllers/subscription_status_controller.rb +84 -84
- data/lib/advanced_billing/controllers/subscriptions_controller.rb +175 -172
- data/lib/advanced_billing/controllers/webhooks_controller.rb +51 -50
- 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/cancellation_method.rb +4 -1
- 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/list_products_filter.rb +12 -2
- 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
@@ -18,12 +18,12 @@ 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
|
-
# @return [ComponentResponse] response from the API call
|
26
|
+
# @return [ComponentResponse] response from the API call.
|
27
27
|
def create_metered_component(product_family_id,
|
28
28
|
body: nil)
|
29
29
|
new_api_call_builder
|
@@ -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,12 +67,12 @@ 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
|
-
# @return [ComponentResponse] response from the API call
|
75
|
+
# @return [ComponentResponse] response from the API call.
|
76
76
|
def create_quantity_based_component(product_family_id,
|
77
77
|
body: nil)
|
78
78
|
new_api_call_builder
|
@@ -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,12 +106,12 @@ 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
|
-
# @return [ComponentResponse] response from the API call
|
114
|
+
# @return [ComponentResponse] response from the API call.
|
115
115
|
def create_on_off_component(product_family_id,
|
116
116
|
body: nil)
|
117
117
|
new_api_call_builder
|
@@ -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,12 +149,12 @@ 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
|
-
# @return [ComponentResponse] response from the API call
|
157
|
+
# @return [ComponentResponse] response from the API call.
|
158
158
|
def create_prepaid_usage_component(product_family_id,
|
159
159
|
body: nil)
|
160
160
|
new_api_call_builder
|
@@ -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,12 +195,12 @@ 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
|
-
# @return [ComponentResponse] response from the API call
|
203
|
+
# @return [ComponentResponse] response from the API call.
|
204
204
|
def create_event_based_component(product_family_id,
|
205
205
|
body: nil)
|
206
206
|
new_api_call_builder
|
@@ -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
|
|
@@ -233,7 +233,7 @@ module AdvancedBilling
|
|
233
233
|
# don't have to save or reference the IDs we generate.
|
234
234
|
# @param [String] handle Required parameter: The handle of the component to
|
235
235
|
# find
|
236
|
-
# @return [ComponentResponse] response from the API call
|
236
|
+
# @return [ComponentResponse] response from the API call.
|
237
237
|
def find_component(handle)
|
238
238
|
new_api_call_builder
|
239
239
|
.request(new_request_builder(HttpMethodEnum::GET,
|
@@ -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,11 +253,12 @@ 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
|
260
|
-
#
|
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:`
|
261
|
+
# @return [ComponentResponse] response from the API call.
|
261
262
|
def read_component(product_family_id,
|
262
263
|
component_id)
|
263
264
|
new_api_call_builder
|
@@ -273,20 +274,21 @@ 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
|
-
# @return [ComponentResponse] response from the API call
|
291
|
+
# @return [ComponentResponse] response from the API call.
|
290
292
|
def update_product_family_component(product_family_id,
|
291
293
|
component_id,
|
292
294
|
body: nil)
|
@@ -306,23 +308,24 @@ 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
|
325
|
-
#
|
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:`
|
328
|
+
# @return [Component] response from the API call.
|
326
329
|
def archive_component(product_family_id,
|
327
330
|
component_id)
|
328
331
|
new_api_call_builder
|
@@ -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
|
|
@@ -384,7 +387,7 @@ module AdvancedBilling
|
|
384
387
|
# Use in query `per_page=200`.
|
385
388
|
# @param [ListComponentsFilter] filter Optional parameter: Filter to use for
|
386
389
|
# List Components operations
|
387
|
-
# @return [Array[ComponentResponse]] response from the API call
|
390
|
+
# @return [Array[ComponentResponse]] response from the API call.
|
388
391
|
def list_components(options = {})
|
389
392
|
new_api_call_builder
|
390
393
|
.request(new_request_builder(HttpMethodEnum::GET,
|
@@ -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
|
|
@@ -415,7 +418,7 @@ module AdvancedBilling
|
|
415
418
|
# @param [String] component_id Required parameter: The id or handle of the
|
416
419
|
# component
|
417
420
|
# @param [UpdateComponentRequest] body Optional parameter: Example:
|
418
|
-
# @return [ComponentResponse] response from the API call
|
421
|
+
# @return [ComponentResponse] response from the API call.
|
419
422
|
def update_component(component_id,
|
420
423
|
body: nil)
|
421
424
|
new_api_call_builder
|
@@ -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
|
@@ -481,7 +484,7 @@ module AdvancedBilling
|
|
481
484
|
# components with a timestamp at or after exact time provided in query. You
|
482
485
|
# can specify timezone in query - otherwise your site's time zone will be
|
483
486
|
# used. If provided, this parameter will be used instead of start_date.
|
484
|
-
# @return [Array[ComponentResponse]] response from the API call
|
487
|
+
# @return [Array[ComponentResponse]] response from the API call.
|
485
488
|
def list_components_for_product_family(options = {})
|
486
489
|
new_api_call_builder
|
487
490
|
.request(new_request_builder(HttpMethodEnum::GET,
|
@@ -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
|