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.
Files changed (127) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +45 -45
  3. data/lib/advanced_billing/configuration.rb +2 -2
  4. data/lib/advanced_billing/controllers/advance_invoice_controller.rb +24 -24
  5. data/lib/advanced_billing/controllers/api_exports_controller.rb +57 -57
  6. data/lib/advanced_billing/controllers/base_controller.rb +10 -10
  7. data/lib/advanced_billing/controllers/billing_portal_controller.rb +33 -32
  8. data/lib/advanced_billing/controllers/component_price_points_controller.rb +60 -60
  9. data/lib/advanced_billing/controllers/components_controller.rb +110 -107
  10. data/lib/advanced_billing/controllers/coupons_controller.rb +89 -89
  11. data/lib/advanced_billing/controllers/custom_fields_controller.rb +76 -76
  12. data/lib/advanced_billing/controllers/customers_controller.rb +45 -41
  13. data/lib/advanced_billing/controllers/events_based_billing_segments_controller.rb +53 -53
  14. data/lib/advanced_billing/controllers/events_controller.rb +16 -15
  15. data/lib/advanced_billing/controllers/insights_controller.rb +17 -17
  16. data/lib/advanced_billing/controllers/invoices_controller.rb +99 -99
  17. data/lib/advanced_billing/controllers/offers_controller.rb +18 -15
  18. data/lib/advanced_billing/controllers/payment_profiles_controller.rb +107 -104
  19. data/lib/advanced_billing/controllers/product_families_controller.rb +26 -26
  20. data/lib/advanced_billing/controllers/product_price_points_controller.rb +62 -62
  21. data/lib/advanced_billing/controllers/products_controller.rb +37 -37
  22. data/lib/advanced_billing/controllers/proforma_invoices_controller.rb +61 -61
  23. data/lib/advanced_billing/controllers/reason_codes_controller.rb +35 -35
  24. data/lib/advanced_billing/controllers/referral_codes_controller.rb +9 -8
  25. data/lib/advanced_billing/controllers/sales_commissions_controller.rb +13 -13
  26. data/lib/advanced_billing/controllers/sites_controller.rb +11 -10
  27. data/lib/advanced_billing/controllers/subscription_components_controller.rb +170 -161
  28. data/lib/advanced_billing/controllers/subscription_group_invoice_account_controller.rb +23 -23
  29. data/lib/advanced_billing/controllers/subscription_group_status_controller.rb +21 -21
  30. data/lib/advanced_billing/controllers/subscription_groups_controller.rb +54 -54
  31. data/lib/advanced_billing/controllers/subscription_invoice_account_controller.rb +37 -37
  32. data/lib/advanced_billing/controllers/subscription_notes_controller.rb +20 -16
  33. data/lib/advanced_billing/controllers/subscription_products_controller.rb +20 -18
  34. data/lib/advanced_billing/controllers/subscription_status_controller.rb +74 -74
  35. data/lib/advanced_billing/controllers/subscriptions_controller.rb +163 -160
  36. data/lib/advanced_billing/controllers/webhooks_controller.rb +45 -44
  37. data/lib/advanced_billing/exceptions/component_allocation_error_exception.rb +15 -15
  38. data/lib/advanced_billing/exceptions/component_price_point_error_exception.rb +15 -15
  39. data/lib/advanced_billing/exceptions/customer_error_response_exception.rb +15 -15
  40. data/lib/advanced_billing/exceptions/error_array_map_response_exception.rb +15 -15
  41. data/lib/advanced_billing/exceptions/error_list_response_exception.rb +15 -15
  42. data/lib/advanced_billing/exceptions/error_string_map_response_exception.rb +15 -15
  43. data/lib/advanced_billing/exceptions/event_based_billing_list_segments_errors_exception.rb +15 -15
  44. data/lib/advanced_billing/exceptions/event_based_billing_segment_errors_exception.rb +15 -15
  45. data/lib/advanced_billing/exceptions/event_based_billing_segment_exception.rb +15 -15
  46. data/lib/advanced_billing/exceptions/product_price_point_error_response_exception.rb +15 -15
  47. data/lib/advanced_billing/exceptions/proforma_bad_request_error_response_exception.rb +15 -15
  48. data/lib/advanced_billing/exceptions/refund_prepayment_base_errors_response_exception.rb +15 -15
  49. data/lib/advanced_billing/exceptions/single_error_response_exception.rb +15 -15
  50. data/lib/advanced_billing/exceptions/single_string_error_response_exception.rb +15 -15
  51. data/lib/advanced_billing/exceptions/subscription_add_coupon_error_exception.rb +15 -15
  52. data/lib/advanced_billing/exceptions/subscription_component_allocation_error_exception.rb +15 -15
  53. data/lib/advanced_billing/exceptions/subscription_group_create_error_response_exception.rb +15 -15
  54. data/lib/advanced_billing/exceptions/subscription_group_signup_error_response_exception.rb +15 -15
  55. data/lib/advanced_billing/exceptions/subscription_group_update_error_response_exception.rb +15 -15
  56. data/lib/advanced_billing/exceptions/subscription_remove_coupon_errors_exception.rb +15 -15
  57. data/lib/advanced_billing/exceptions/subscriptions_mrr_error_response_exception.rb +15 -15
  58. data/lib/advanced_billing/exceptions/too_many_management_link_requests_error_exception.rb +15 -15
  59. data/lib/advanced_billing/models/activate_event_based_component.rb +84 -0
  60. data/lib/advanced_billing/models/{current_vault.rb → all_vaults.rb} +28 -7
  61. data/lib/advanced_billing/models/allocation.rb +1 -0
  62. data/lib/advanced_billing/models/allocation_preview_item.rb +1 -0
  63. data/lib/advanced_billing/models/apple_pay_payment_profile.rb +232 -0
  64. data/lib/advanced_billing/models/apple_pay_vault.rb +20 -0
  65. data/lib/advanced_billing/models/bank_account_attributes.rb +2 -0
  66. data/lib/advanced_billing/models/bank_account_payment_profile.rb +25 -20
  67. data/lib/advanced_billing/models/bank_account_vault.rb +19 -9
  68. data/lib/advanced_billing/models/change_invoice_status_event_data.rb +6 -6
  69. data/lib/advanced_billing/models/component.rb +1 -0
  70. data/lib/advanced_billing/models/component_custom_price.rb +33 -14
  71. data/lib/advanced_billing/models/component_price_point_item.rb +3 -1
  72. data/lib/advanced_billing/models/create_component_price_point.rb +3 -1
  73. data/lib/advanced_billing/models/create_customer.rb +11 -1
  74. data/lib/advanced_billing/models/create_metafield.rb +2 -1
  75. data/lib/advanced_billing/models/create_or_update_product.rb +7 -4
  76. data/lib/advanced_billing/models/create_payment_profile.rb +1 -1
  77. data/lib/advanced_billing/models/create_prepaid_usage_component_price_point.rb +6 -5
  78. data/lib/advanced_billing/models/create_product_price_point.rb +5 -3
  79. data/lib/advanced_billing/models/create_subscription.rb +27 -25
  80. data/lib/advanced_billing/models/credit_card_payment_profile.rb +17 -16
  81. data/lib/advanced_billing/models/credit_card_vault.rb +117 -0
  82. data/lib/advanced_billing/models/credit_note.rb +2 -2
  83. data/lib/advanced_billing/models/customer.rb +11 -1
  84. data/lib/advanced_billing/models/customer_attributes.rb +12 -1
  85. data/lib/advanced_billing/models/ebb_component.rb +1 -0
  86. data/lib/advanced_billing/models/{extended_interval_unit.rb → expiration_interval_unit.rb} +4 -4
  87. data/lib/advanced_billing/models/full_subscription_group_response.rb +65 -50
  88. data/lib/advanced_billing/models/get_one_time_token_payment_profile.rb +1 -1
  89. data/lib/advanced_billing/models/invoice.rb +19 -9
  90. data/lib/advanced_billing/models/invoice_consolidation_level.rb +2 -2
  91. data/lib/advanced_billing/models/invoice_refund.rb +13 -1
  92. data/lib/advanced_billing/models/invoice_status.rb +2 -2
  93. data/lib/advanced_billing/models/invoice_tax.rb +29 -0
  94. data/lib/advanced_billing/models/invoice_tax_component_breakout.rb +101 -1
  95. data/lib/advanced_billing/models/issue_invoice_event_data.rb +6 -6
  96. data/lib/advanced_billing/models/metered_component.rb +4 -3
  97. data/lib/advanced_billing/models/offer_item.rb +3 -1
  98. data/lib/advanced_billing/models/on_off_component.rb +3 -2
  99. data/lib/advanced_billing/models/paid_invoice.rb +2 -2
  100. data/lib/advanced_billing/models/pay_pal_vault.rb +29 -0
  101. data/lib/advanced_billing/models/payment_profile_attributes.rb +5 -5
  102. data/lib/advanced_billing/models/payment_profile_response.rb +3 -3
  103. data/lib/advanced_billing/models/payment_type.rb +4 -1
  104. data/lib/advanced_billing/models/paypal_payment_profile.rb +242 -0
  105. data/lib/advanced_billing/models/prepaid_usage_component.rb +5 -4
  106. data/lib/advanced_billing/models/product.rb +2 -2
  107. data/lib/advanced_billing/models/product_price_point.rb +2 -2
  108. data/lib/advanced_billing/models/proforma_invoice.rb +6 -6
  109. data/lib/advanced_billing/models/quantity_based_component.rb +4 -3
  110. data/lib/advanced_billing/models/refund_invoice_event_data.rb +4 -4
  111. data/lib/advanced_billing/models/resent_invitation.rb +36 -0
  112. data/lib/advanced_billing/models/subscription.rb +13 -10
  113. data/lib/advanced_billing/models/subscription_component.rb +1 -0
  114. data/lib/advanced_billing/models/subscription_component_subscription.rb +26 -20
  115. data/lib/advanced_billing/models/subscription_custom_price.rb +5 -2
  116. data/lib/advanced_billing/models/subscription_group_bank_account.rb +2 -0
  117. data/lib/advanced_billing/models/subscription_group_credit_card.rb +1 -1
  118. data/lib/advanced_billing/models/subscription_group_signup_response.rb +39 -30
  119. data/lib/advanced_billing/models/subscription_state.rb +30 -30
  120. data/lib/advanced_billing/models/tax_configuration.rb +1 -2
  121. data/lib/advanced_billing/models/update_component_price_point.rb +3 -1
  122. data/lib/advanced_billing/models/update_customer.rb +12 -1
  123. data/lib/advanced_billing/models/update_payment_profile.rb +1 -1
  124. data/lib/advanced_billing/utilities/file_wrapper.rb +9 -9
  125. data/lib/advanced_billing/utilities/union_type_lookup.rb +17 -3
  126. data/lib/advanced_billing.rb +10 -4
  127. metadata +16 -10
@@ -13,19 +13,20 @@ module AdvancedBilling
13
13
  # identifier for the customer from your own app, i.e. the customer’s ID.
14
14
  # This allows you to retrieve a given customer via a piece of shared
15
15
  # information. Alternatively, you may choose to leave `reference` blank, and
16
- # store Chargify’s unique ID for the customer, which is in the `id`
16
+ # store Advanced Billing’s unique ID for the customer, which is in the `id`
17
17
  # attribute.
18
18
  # Full documentation on how to locate, create and edit Customers in the
19
- # Chargify UI can be located
20
- # [here](https://chargify.zendesk.com/hc/en-us/articles/4407659914267).
19
+ # Advanced Billing UI can be located
20
+ # [here](https://maxio.zendesk.com/hc/en-us/articles/24252190590093-Customer
21
+ # -Details).
21
22
  # ## Required Country Format
22
- # Chargify requires that you use the ISO Standard Country codes when
23
+ # Advanced Billing requires that you use the ISO Standard Country codes when
23
24
  # formatting country attribute of the customer.
24
25
  # Countries should be formatted as 2 characters. For more information,
25
26
  # please see the following wikipedia article on
26
27
  # [ISO_3166-1.](http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes)
27
28
  # ## Required State Format
28
- # Chargify requires that you use the ISO Standard State codes when
29
+ # Advanced Billing requires that you use the ISO Standard State codes when
29
30
  # formatting state attribute of the customer.
30
31
  # + US States (2 characters):
31
32
  # [ISO_3166-2](https://en.wikipedia.org/wiki/ISO_3166-2:US)
@@ -35,11 +36,11 @@ module AdvancedBilling
35
36
  # click on the link in the “ISO 3166-2 codes” column next to country you
36
37
  # wish to populate.
37
38
  # ## Locale
38
- # Chargify allows you to attribute a language/region to your customer to
39
- # deliver invoices in any required language.
39
+ # Advanced Billing allows you to attribute a language/region to your
40
+ # customer to deliver invoices in any required language.
40
41
  # For more: [Customer
41
- # Locale](https://chargify.zendesk.com/hc/en-us/articles/4407870384283#custo
42
- # mer-locale)
42
+ # Locale](https://maxio.zendesk.com/hc/en-us/articles/24286672013709-Custome
43
+ # r-Locale)
43
44
  # @param [CreateCustomerRequest] body Optional parameter: Example:
44
45
  # @return [CustomerResponse] response from the API call
45
46
  def create_customer(body: nil)
@@ -53,12 +54,12 @@ module AdvancedBilling
53
54
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
54
55
  .auth(Single.new('BasicAuth')))
55
56
  .response(new_response_handler
56
- .deserializer(APIHelper.method(:custom_type_deserializer))
57
- .deserialize_into(CustomerResponse.method(:from_hash))
58
- .local_error_template('422',
59
- 'HTTP Response Not OK. Status code: {$statusCode}.'\
60
- ' Response: \'{$response.body}\'.',
61
- CustomerErrorResponseException))
57
+ .deserializer(APIHelper.method(:custom_type_deserializer))
58
+ .deserialize_into(CustomerResponse.method(:from_hash))
59
+ .local_error_template('422',
60
+ 'HTTP Response Not OK. Status code: {$statusCode}.'\
61
+ ' Response: \'{$response.body}\'.',
62
+ CustomerErrorResponseException))
62
63
  .execute
63
64
  end
64
65
 
@@ -68,7 +69,7 @@ module AdvancedBilling
68
69
  # of customers that matches the search query.
69
70
  # Common use cases are:
70
71
  # + Search by an email
71
- # + Search by a Chargify ID
72
+ # + Search by an Advanced Billing ID
72
73
  # + Search by an organization
73
74
  # + Search by a reference value from your application
74
75
  # + Search by a first or last name
@@ -129,15 +130,16 @@ module AdvancedBilling
129
130
  .header_param(new_parameter('application/json', key: 'accept'))
130
131
  .auth(Single.new('BasicAuth')))
131
132
  .response(new_response_handler
132
- .deserializer(APIHelper.method(:custom_type_deserializer))
133
- .deserialize_into(CustomerResponse.method(:from_hash))
134
- .is_response_array(true))
133
+ .deserializer(APIHelper.method(:custom_type_deserializer))
134
+ .deserialize_into(CustomerResponse.method(:from_hash))
135
+ .is_response_array(true))
135
136
  .execute
136
137
  end
137
138
 
138
- # This method allows to retrieve the Customer properties by
139
- # Chargify-generated Customer ID.
140
- # @param [Integer] id Required parameter: The Chargify id of the customer
139
+ # This method allows to retrieve the Customer properties by Advanced
140
+ # Billing-generated Customer ID.
141
+ # @param [Integer] id Required parameter: The Advanced Billing id of the
142
+ # customer
141
143
  # @return [CustomerResponse] response from the API call
142
144
  def read_customer(id)
143
145
  new_api_call_builder
@@ -150,13 +152,14 @@ module AdvancedBilling
150
152
  .header_param(new_parameter('application/json', key: 'accept'))
151
153
  .auth(Single.new('BasicAuth')))
152
154
  .response(new_response_handler
153
- .deserializer(APIHelper.method(:custom_type_deserializer))
154
- .deserialize_into(CustomerResponse.method(:from_hash)))
155
+ .deserializer(APIHelper.method(:custom_type_deserializer))
156
+ .deserialize_into(CustomerResponse.method(:from_hash)))
155
157
  .execute
156
158
  end
157
159
 
158
160
  # This method allows to update the Customer.
159
- # @param [Integer] id Required parameter: The Chargify id of the customer
161
+ # @param [Integer] id Required parameter: The Advanced Billing id of the
162
+ # customer
160
163
  # @param [UpdateCustomerRequest] body Optional parameter: Example:
161
164
  # @return [CustomerResponse] response from the API call
162
165
  def update_customer(id,
@@ -174,20 +177,21 @@ module AdvancedBilling
174
177
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
175
178
  .auth(Single.new('BasicAuth')))
176
179
  .response(new_response_handler
177
- .deserializer(APIHelper.method(:custom_type_deserializer))
178
- .deserialize_into(CustomerResponse.method(:from_hash))
179
- .local_error_template('404',
180
- 'Not Found:\'{$response.body}\'',
181
- APIException)
182
- .local_error_template('422',
183
- 'HTTP Response Not OK. Status code: {$statusCode}.'\
184
- ' Response: \'{$response.body}\'.',
185
- CustomerErrorResponseException))
180
+ .deserializer(APIHelper.method(:custom_type_deserializer))
181
+ .deserialize_into(CustomerResponse.method(:from_hash))
182
+ .local_error_template('404',
183
+ 'Not Found:\'{$response.body}\'',
184
+ APIException)
185
+ .local_error_template('422',
186
+ 'HTTP Response Not OK. Status code: {$statusCode}.'\
187
+ ' Response: \'{$response.body}\'.',
188
+ CustomerErrorResponseException))
186
189
  .execute
187
190
  end
188
191
 
189
192
  # This method allows you to delete the Customer.
190
- # @param [Integer] id Required parameter: The Chargify id of the customer
193
+ # @param [Integer] id Required parameter: The Advanced Billing id of the
194
+ # customer
191
195
  # @return [void] response from the API call
192
196
  def delete_customer(id)
193
197
  new_api_call_builder
@@ -199,7 +203,7 @@ module AdvancedBilling
199
203
  .should_encode(true))
200
204
  .auth(Single.new('BasicAuth')))
201
205
  .response(new_response_handler
202
- .is_response_void(true))
206
+ .is_response_void(true))
203
207
  .execute
204
208
  end
205
209
 
@@ -217,8 +221,8 @@ module AdvancedBilling
217
221
  .header_param(new_parameter('application/json', key: 'accept'))
218
222
  .auth(Single.new('BasicAuth')))
219
223
  .response(new_response_handler
220
- .deserializer(APIHelper.method(:custom_type_deserializer))
221
- .deserialize_into(CustomerResponse.method(:from_hash)))
224
+ .deserializer(APIHelper.method(:custom_type_deserializer))
225
+ .deserialize_into(CustomerResponse.method(:from_hash)))
222
226
  .execute
223
227
  end
224
228
 
@@ -237,9 +241,9 @@ module AdvancedBilling
237
241
  .header_param(new_parameter('application/json', key: 'accept'))
238
242
  .auth(Single.new('BasicAuth')))
239
243
  .response(new_response_handler
240
- .deserializer(APIHelper.method(:custom_type_deserializer))
241
- .deserialize_into(SubscriptionResponse.method(:from_hash))
242
- .is_response_array(true))
244
+ .deserializer(APIHelper.method(:custom_type_deserializer))
245
+ .deserialize_into(SubscriptionResponse.method(:from_hash))
246
+ .is_response_array(true))
243
247
  .execute
244
248
  end
245
249
  end
@@ -37,15 +37,15 @@ module AdvancedBilling
37
37
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
38
38
  .auth(Single.new('BasicAuth')))
39
39
  .response(new_response_handler
40
- .deserializer(APIHelper.method(:custom_type_deserializer))
41
- .deserialize_into(SegmentResponse.method(:from_hash))
42
- .local_error_template('404',
43
- 'Not Found:\'{$response.body}\'',
44
- APIException)
45
- .local_error_template('422',
46
- 'HTTP Response Not OK. Status code: {$statusCode}.'\
47
- ' Response: \'{$response.body}\'.',
48
- EventBasedBillingSegmentErrorsException))
40
+ .deserializer(APIHelper.method(:custom_type_deserializer))
41
+ .deserialize_into(SegmentResponse.method(:from_hash))
42
+ .local_error_template('404',
43
+ 'Not Found:\'{$response.body}\'',
44
+ APIException)
45
+ .local_error_template('422',
46
+ 'HTTP Response Not OK. Status code: {$statusCode}.'\
47
+ ' Response: \'{$response.body}\'.',
48
+ EventBasedBillingSegmentErrorsException))
49
49
  .execute
50
50
  end
51
51
 
@@ -92,15 +92,15 @@ module AdvancedBilling
92
92
  .auth(Single.new('BasicAuth'))
93
93
  .array_serialization_format(ArraySerializationFormat::CSV))
94
94
  .response(new_response_handler
95
- .deserializer(APIHelper.method(:custom_type_deserializer))
96
- .deserialize_into(ListSegmentsResponse.method(:from_hash))
97
- .local_error_template('404',
98
- 'Not Found:\'{$response.body}\'',
99
- APIException)
100
- .local_error_template('422',
101
- 'HTTP Response Not OK. Status code: {$statusCode}.'\
102
- ' Response: \'{$response.body}\'.',
103
- EventBasedBillingListSegmentsErrorsException))
95
+ .deserializer(APIHelper.method(:custom_type_deserializer))
96
+ .deserialize_into(ListSegmentsResponse.method(:from_hash))
97
+ .local_error_template('404',
98
+ 'Not Found:\'{$response.body}\'',
99
+ APIException)
100
+ .local_error_template('422',
101
+ 'HTTP Response Not OK. Status code: {$statusCode}.'\
102
+ ' Response: \'{$response.body}\'.',
103
+ EventBasedBillingListSegmentsErrorsException))
104
104
  .execute
105
105
  end
106
106
 
@@ -138,15 +138,15 @@ module AdvancedBilling
138
138
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
139
139
  .auth(Single.new('BasicAuth')))
140
140
  .response(new_response_handler
141
- .deserializer(APIHelper.method(:custom_type_deserializer))
142
- .deserialize_into(SegmentResponse.method(:from_hash))
143
- .local_error_template('404',
144
- 'Not Found:\'{$response.body}\'',
145
- APIException)
146
- .local_error_template('422',
147
- 'HTTP Response Not OK. Status code: {$statusCode}.'\
148
- ' Response: \'{$response.body}\'.',
149
- EventBasedBillingSegmentErrorsException))
141
+ .deserializer(APIHelper.method(:custom_type_deserializer))
142
+ .deserialize_into(SegmentResponse.method(:from_hash))
143
+ .local_error_template('404',
144
+ 'Not Found:\'{$response.body}\'',
145
+ APIException)
146
+ .local_error_template('422',
147
+ 'HTTP Response Not OK. Status code: {$statusCode}.'\
148
+ ' Response: \'{$response.body}\'.',
149
+ EventBasedBillingSegmentErrorsException))
150
150
  .execute
151
151
  end
152
152
 
@@ -177,14 +177,14 @@ module AdvancedBilling
177
177
  .should_encode(true))
178
178
  .auth(Single.new('BasicAuth')))
179
179
  .response(new_response_handler
180
- .is_response_void(true)
181
- .local_error_template('404',
182
- 'Not Found:\'{$response.body}\'',
183
- APIException)
184
- .local_error_template('422',
185
- 'HTTP Response Not OK. Status code: {$statusCode}.'\
186
- ' Response: \'{$response.body}\'.',
187
- APIException))
180
+ .is_response_void(true)
181
+ .local_error_template('404',
182
+ 'Not Found:\'{$response.body}\'',
183
+ APIException)
184
+ .local_error_template('422',
185
+ 'HTTP Response Not OK. Status code: {$statusCode}.'\
186
+ ' Response: \'{$response.body}\'.',
187
+ APIException))
188
188
  .execute
189
189
  end
190
190
 
@@ -221,15 +221,15 @@ module AdvancedBilling
221
221
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
222
222
  .auth(Single.new('BasicAuth')))
223
223
  .response(new_response_handler
224
- .deserializer(APIHelper.method(:custom_type_deserializer))
225
- .deserialize_into(ListSegmentsResponse.method(:from_hash))
226
- .local_error_template('404',
227
- 'Not Found:\'{$response.body}\'',
228
- APIException)
229
- .local_error_template('422',
230
- 'HTTP Response Not OK. Status code: {$statusCode}.'\
231
- ' Response: \'{$response.body}\'.',
232
- EventBasedBillingSegmentException))
224
+ .deserializer(APIHelper.method(:custom_type_deserializer))
225
+ .deserialize_into(ListSegmentsResponse.method(:from_hash))
226
+ .local_error_template('404',
227
+ 'Not Found:\'{$response.body}\'',
228
+ APIException)
229
+ .local_error_template('422',
230
+ 'HTTP Response Not OK. Status code: {$statusCode}.'\
231
+ ' Response: \'{$response.body}\'.',
232
+ EventBasedBillingSegmentException))
233
233
  .execute
234
234
  end
235
235
 
@@ -266,15 +266,15 @@ module AdvancedBilling
266
266
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
267
267
  .auth(Single.new('BasicAuth')))
268
268
  .response(new_response_handler
269
- .deserializer(APIHelper.method(:custom_type_deserializer))
270
- .deserialize_into(ListSegmentsResponse.method(:from_hash))
271
- .local_error_template('404',
272
- 'Not Found:\'{$response.body}\'',
273
- APIException)
274
- .local_error_template('422',
275
- 'HTTP Response Not OK. Status code: {$statusCode}.'\
276
- ' Response: \'{$response.body}\'.',
277
- EventBasedBillingSegmentException))
269
+ .deserializer(APIHelper.method(:custom_type_deserializer))
270
+ .deserialize_into(ListSegmentsResponse.method(:from_hash))
271
+ .local_error_template('404',
272
+ 'Not Found:\'{$response.body}\'',
273
+ APIException)
274
+ .local_error_template('422',
275
+ 'HTTP Response Not OK. Status code: {$statusCode}.'\
276
+ ' Response: \'{$response.body}\'.',
277
+ EventBasedBillingSegmentException))
278
278
  .execute
279
279
  end
280
280
  end
@@ -7,13 +7,14 @@ module AdvancedBilling
7
7
  # EventsController
8
8
  class EventsController < BaseController
9
9
  # ## Events Intro
10
- # Chargify Events include various activity that happens around a Site. This
11
- # information is **especially** useful to track down issues that arise when
12
- # subscriptions are not created due to errors.
13
- # Within the Chargify UI, "Events" are referred to as "Site Activity". Full
14
- # documentation on how to record view Events / Site Activty in the Chargify
15
- # UI can be located
16
- # [here](https://chargify.zendesk.com/hc/en-us/articles/4407864698139).
10
+ # Advanced Billing Events include various activity that happens around a
11
+ # Site. This information is **especially** useful to track down issues that
12
+ # arise when subscriptions are not created due to errors.
13
+ # Within the Advanced Billing UI, "Events" are referred to as "Site
14
+ # Activity". Full documentation on how to record view Events / Site Activty
15
+ # in the Advanced Billing UI can be located
16
+ # [here](https://maxio.zendesk.com/hc/en-us/articles/24250671733517-Site-Act
17
+ # ivity).
17
18
  # ## List Events for a Site
18
19
  # This method will retrieve a list of events for a site. Use query string
19
20
  # filters to narrow down results. You may use the `key` filter as part of
@@ -126,9 +127,9 @@ module AdvancedBilling
126
127
  .auth(Single.new('BasicAuth'))
127
128
  .array_serialization_format(ArraySerializationFormat::CSV))
128
129
  .response(new_response_handler
129
- .deserializer(APIHelper.method(:custom_type_deserializer))
130
- .deserialize_into(EventResponse.method(:from_hash))
131
- .is_response_array(true))
130
+ .deserializer(APIHelper.method(:custom_type_deserializer))
131
+ .deserialize_into(EventResponse.method(:from_hash))
132
+ .is_response_array(true))
132
133
  .execute
133
134
  end
134
135
 
@@ -175,9 +176,9 @@ module AdvancedBilling
175
176
  .auth(Single.new('BasicAuth'))
176
177
  .array_serialization_format(ArraySerializationFormat::CSV))
177
178
  .response(new_response_handler
178
- .deserializer(APIHelper.method(:custom_type_deserializer))
179
- .deserialize_into(EventResponse.method(:from_hash))
180
- .is_response_array(true))
179
+ .deserializer(APIHelper.method(:custom_type_deserializer))
180
+ .deserialize_into(EventResponse.method(:from_hash))
181
+ .is_response_array(true))
181
182
  .execute
182
183
  end
183
184
 
@@ -218,8 +219,8 @@ module AdvancedBilling
218
219
  .auth(Single.new('BasicAuth'))
219
220
  .array_serialization_format(ArraySerializationFormat::CSV))
220
221
  .response(new_response_handler
221
- .deserializer(APIHelper.method(:custom_type_deserializer))
222
- .deserialize_into(CountResponse.method(:from_hash)))
222
+ .deserializer(APIHelper.method(:custom_type_deserializer))
223
+ .deserialize_into(CountResponse.method(:from_hash)))
223
224
  .execute
224
225
  end
225
226
  end
@@ -24,8 +24,8 @@ module AdvancedBilling
24
24
  .header_param(new_parameter('application/json', key: 'accept'))
25
25
  .auth(Single.new('BasicAuth')))
26
26
  .response(new_response_handler
27
- .deserializer(APIHelper.method(:custom_type_deserializer))
28
- .deserialize_into(SiteSummary.method(:from_hash)))
27
+ .deserializer(APIHelper.method(:custom_type_deserializer))
28
+ .deserialize_into(SiteSummary.method(:from_hash)))
29
29
  .execute
30
30
  end
31
31
 
@@ -48,16 +48,16 @@ module AdvancedBilling
48
48
  .header_param(new_parameter('application/json', key: 'accept'))
49
49
  .auth(Single.new('BasicAuth')))
50
50
  .response(new_response_handler
51
- .deserializer(APIHelper.method(:custom_type_deserializer))
52
- .deserialize_into(MRRResponse.method(:from_hash)))
51
+ .deserializer(APIHelper.method(:custom_type_deserializer))
52
+ .deserialize_into(MRRResponse.method(:from_hash)))
53
53
  .execute
54
54
  end
55
55
 
56
56
  # This endpoint returns your site's MRR movements.
57
57
  # ## Understanding MRR movements
58
58
  # This endpoint will aid in accessing your site's [MRR
59
- # Report](https://chargify.zendesk.com/hc/en-us/articles/4407838249627)
60
- # data.
59
+ # Report](https://maxio.zendesk.com/hc/en-us/articles/24285894587021-MRR-Ana
60
+ # lytics) data.
61
61
  # Whenever a subscription event occurs that causes your site's MRR to change
62
62
  # (such as a signup or upgrade), we record an MRR movement. These records
63
63
  # are accessible via the MRR Movements endpoint.
@@ -66,9 +66,9 @@ module AdvancedBilling
66
66
  # configuration at the time of the movement.
67
67
  # ### Plan & Usage Breakouts
68
68
  # In the MRR Report UI, we support a setting to [include or
69
- # exclude](https://chargify.zendesk.com/hc/en-us/articles/4407838249627#disp
70
- # laying-component-based-metered-usage-in-mrr) usage revenue. In the MRR
71
- # APIs, responses include `plan` and `usage` breakouts.
69
+ # exclude](https://maxio.zendesk.com/hc/en-us/articles/24285894587021-MRR-An
70
+ # alytics#displaying-component-based-metered-usage-in-mrr) usage revenue. In
71
+ # the MRR APIs, responses include `plan` and `usage` breakouts.
72
72
  # Plan includes revenue from:
73
73
  # * Products
74
74
  # * Quantity-Based Components
@@ -105,8 +105,8 @@ module AdvancedBilling
105
105
  .header_param(new_parameter('application/json', key: 'accept'))
106
106
  .auth(Single.new('BasicAuth')))
107
107
  .response(new_response_handler
108
- .deserializer(APIHelper.method(:custom_type_deserializer))
109
- .deserialize_into(ListMRRResponse.method(:from_hash)))
108
+ .deserializer(APIHelper.method(:custom_type_deserializer))
109
+ .deserialize_into(ListMRRResponse.method(:from_hash)))
110
110
  .execute
111
111
  end
112
112
 
@@ -148,12 +148,12 @@ module AdvancedBilling
148
148
  .auth(Single.new('BasicAuth'))
149
149
  .array_serialization_format(ArraySerializationFormat::CSV))
150
150
  .response(new_response_handler
151
- .deserializer(APIHelper.method(:custom_type_deserializer))
152
- .deserialize_into(SubscriptionMRRResponse.method(:from_hash))
153
- .local_error_template('400',
154
- 'HTTP Response Not OK. Status code: {$statusCode}.'\
155
- ' Response: \'{$response.body}\'.',
156
- SubscriptionsMrrErrorResponseException))
151
+ .deserializer(APIHelper.method(:custom_type_deserializer))
152
+ .deserialize_into(SubscriptionMRRResponse.method(:from_hash))
153
+ .local_error_template('400',
154
+ 'HTTP Response Not OK. Status code: {$statusCode}.'\
155
+ ' Response: \'{$response.body}\'.',
156
+ SubscriptionsMrrErrorResponseException))
157
157
  .execute
158
158
  end
159
159
  end