maxio-advanced-billing-sdk 5.2.0 → 6.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (530) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +48 -50
  3. data/lib/advanced_billing/client.rb +3 -4
  4. data/lib/advanced_billing/configuration.rb +21 -24
  5. data/lib/advanced_billing/controllers/advance_invoice_controller.rb +3 -3
  6. data/lib/advanced_billing/controllers/api_exports_controller.rb +9 -9
  7. data/lib/advanced_billing/controllers/base_controller.rb +1 -1
  8. data/lib/advanced_billing/controllers/billing_portal_controller.rb +4 -4
  9. data/lib/advanced_billing/controllers/component_price_points_controller.rb +34 -20
  10. data/lib/advanced_billing/controllers/components_controller.rb +12 -12
  11. data/lib/advanced_billing/controllers/coupons_controller.rb +45 -27
  12. data/lib/advanced_billing/controllers/custom_fields_controller.rb +9 -9
  13. data/lib/advanced_billing/controllers/customers_controller.rb +7 -7
  14. data/lib/advanced_billing/controllers/events_based_billing_segments_controller.rb +6 -6
  15. data/lib/advanced_billing/controllers/events_controller.rb +26 -9
  16. data/lib/advanced_billing/controllers/insights_controller.rb +4 -4
  17. data/lib/advanced_billing/controllers/invoices_controller.rb +17 -17
  18. data/lib/advanced_billing/controllers/offers_controller.rb +10 -6
  19. data/lib/advanced_billing/controllers/payment_profiles_controller.rb +12 -12
  20. data/lib/advanced_billing/controllers/product_families_controller.rb +22 -20
  21. data/lib/advanced_billing/controllers/product_price_points_controller.rb +14 -11
  22. data/lib/advanced_billing/controllers/products_controller.rb +6 -6
  23. data/lib/advanced_billing/controllers/proforma_invoices_controller.rb +9 -9
  24. data/lib/advanced_billing/controllers/reason_codes_controller.rb +17 -9
  25. data/lib/advanced_billing/controllers/referral_codes_controller.rb +1 -1
  26. data/lib/advanced_billing/controllers/sales_commissions_controller.rb +3 -3
  27. data/lib/advanced_billing/controllers/sites_controller.rb +3 -3
  28. data/lib/advanced_billing/controllers/subscription_components_controller.rb +21 -31
  29. data/lib/advanced_billing/controllers/subscription_group_invoice_account_controller.rb +4 -4
  30. data/lib/advanced_billing/controllers/subscription_group_status_controller.rb +4 -4
  31. data/lib/advanced_billing/controllers/subscription_groups_controller.rb +9 -9
  32. data/lib/advanced_billing/controllers/subscription_invoice_account_controller.rb +6 -6
  33. data/lib/advanced_billing/controllers/subscription_notes_controller.rb +20 -8
  34. data/lib/advanced_billing/controllers/subscription_products_controller.rb +2 -2
  35. data/lib/advanced_billing/controllers/subscription_status_controller.rb +20 -12
  36. data/lib/advanced_billing/controllers/subscriptions_controller.rb +40 -17
  37. data/lib/advanced_billing/controllers/webhooks_controller.rb +6 -6
  38. data/lib/advanced_billing/exceptions/subscription_response_error_exception.rb +32 -0
  39. data/lib/advanced_billing/models/account_balance.rb +7 -7
  40. data/lib/advanced_billing/models/account_balances.rb +7 -7
  41. data/lib/advanced_billing/models/ach_agreement.rb +7 -7
  42. data/lib/advanced_billing/models/activate_event_based_component.rb +6 -6
  43. data/lib/advanced_billing/models/activate_subscription_request.rb +4 -4
  44. data/lib/advanced_billing/models/add_coupons_request.rb +4 -4
  45. data/lib/advanced_billing/models/add_subscription_to_a_group.rb +6 -18
  46. data/lib/advanced_billing/models/address_change.rb +5 -5
  47. data/lib/advanced_billing/models/agreement_acceptance.rb +7 -7
  48. data/lib/advanced_billing/models/allocate_components.rb +7 -7
  49. data/lib/advanced_billing/models/allocation.rb +7 -7
  50. data/lib/advanced_billing/models/allocation_expiration_date.rb +4 -4
  51. data/lib/advanced_billing/models/allocation_preview.rb +7 -7
  52. data/lib/advanced_billing/models/allocation_preview_item.rb +7 -7
  53. data/lib/advanced_billing/models/allocation_preview_line_item.rb +7 -7
  54. data/lib/advanced_billing/models/allocation_preview_response.rb +4 -4
  55. data/lib/advanced_billing/models/allocation_response.rb +4 -4
  56. data/lib/advanced_billing/models/allocation_settings.rb +6 -6
  57. data/lib/advanced_billing/models/apple_pay_payment_profile.rb +7 -7
  58. data/lib/advanced_billing/models/applied_credit_note_data.rb +5 -5
  59. data/lib/advanced_billing/models/apply_credit_note_event.rb +7 -7
  60. data/lib/advanced_billing/models/apply_credit_note_event_data.rb +7 -7
  61. data/lib/advanced_billing/models/apply_debit_note_event.rb +7 -7
  62. data/lib/advanced_billing/models/apply_debit_note_event_data.rb +7 -7
  63. data/lib/advanced_billing/models/apply_payment_event.rb +7 -7
  64. data/lib/advanced_billing/models/apply_payment_event_data.rb +7 -7
  65. data/lib/advanced_billing/models/attribute_error.rb +4 -4
  66. data/lib/advanced_billing/models/auto_resume.rb +4 -4
  67. data/lib/advanced_billing/models/backport_invoice_event.rb +7 -7
  68. data/lib/advanced_billing/models/bank_account_attributes.rb +7 -7
  69. data/lib/advanced_billing/models/bank_account_payment_profile.rb +7 -7
  70. data/lib/advanced_billing/models/bank_account_response.rb +4 -4
  71. data/lib/advanced_billing/models/bank_account_verification.rb +5 -5
  72. data/lib/advanced_billing/models/bank_account_verification_request.rb +4 -4
  73. data/lib/advanced_billing/models/base_model.rb +76 -28
  74. data/lib/advanced_billing/models/base_refund_error.rb +4 -4
  75. data/lib/advanced_billing/models/base_string_error.rb +4 -4
  76. data/lib/advanced_billing/models/batch_job.rb +7 -7
  77. data/lib/advanced_billing/models/batch_job_response.rb +4 -4
  78. data/lib/advanced_billing/models/billing_manifest.rb +7 -7
  79. data/lib/advanced_billing/models/billing_manifest_item.rb +7 -7
  80. data/lib/advanced_billing/models/billing_schedule.rb +4 -4
  81. data/lib/advanced_billing/models/breakouts.rb +7 -7
  82. data/lib/advanced_billing/models/bulk_components_price_point_assignment.rb +4 -4
  83. data/lib/advanced_billing/models/bulk_create_product_price_points_request.rb +4 -4
  84. data/lib/advanced_billing/models/bulk_create_product_price_points_response.rb +4 -4
  85. data/lib/advanced_billing/models/bulk_create_segments.rb +4 -4
  86. data/lib/advanced_billing/models/bulk_update_segments.rb +4 -4
  87. data/lib/advanced_billing/models/bulk_update_segments_item.rb +6 -6
  88. data/lib/advanced_billing/models/calendar_billing.rb +7 -7
  89. data/lib/advanced_billing/models/cancel_grouped_subscriptions_request.rb +4 -4
  90. data/lib/advanced_billing/models/cancellation_options.rb +5 -5
  91. data/lib/advanced_billing/models/cancellation_request.rb +4 -4
  92. data/lib/advanced_billing/models/change_chargeback_status_event.rb +7 -7
  93. data/lib/advanced_billing/models/change_chargeback_status_event_data.rb +4 -4
  94. data/lib/advanced_billing/models/change_invoice_collection_method_event.rb +7 -7
  95. data/lib/advanced_billing/models/change_invoice_collection_method_event_data.rb +5 -5
  96. data/lib/advanced_billing/models/change_invoice_status_event.rb +7 -7
  97. data/lib/advanced_billing/models/change_invoice_status_event_data.rb +7 -7
  98. data/lib/advanced_billing/models/chargify_ebb.rb +7 -7
  99. data/lib/advanced_billing/models/component.rb +9 -9
  100. data/lib/advanced_billing/models/component_allocation_change.rb +7 -7
  101. data/lib/advanced_billing/models/component_allocation_error_item.rb +7 -7
  102. data/lib/advanced_billing/models/component_cost_data.rb +7 -7
  103. data/lib/advanced_billing/models/component_cost_data_rate_tier.rb +7 -7
  104. data/lib/advanced_billing/models/component_currency_price.rb +7 -7
  105. data/lib/advanced_billing/models/component_currency_prices_response.rb +4 -4
  106. data/lib/advanced_billing/models/component_custom_price.rb +7 -7
  107. data/lib/advanced_billing/models/component_price.rb +7 -7
  108. data/lib/advanced_billing/models/component_price_point.rb +92 -7
  109. data/lib/advanced_billing/models/component_price_point_assignment.rb +5 -5
  110. data/lib/advanced_billing/models/component_price_point_error_item.rb +6 -6
  111. data/lib/advanced_billing/models/component_price_point_item.rb +7 -7
  112. data/lib/advanced_billing/models/component_price_point_response.rb +4 -4
  113. data/lib/advanced_billing/models/component_price_points_response.rb +5 -5
  114. data/lib/advanced_billing/models/component_response.rb +4 -4
  115. data/lib/advanced_billing/models/compounding_strategy.rb +5 -1
  116. data/lib/advanced_billing/models/consolidated_invoice.rb +4 -4
  117. data/lib/advanced_billing/models/count_response.rb +4 -4
  118. data/lib/advanced_billing/models/coupon.rb +104 -29
  119. data/lib/advanced_billing/models/coupon_currency.rb +12 -9
  120. data/lib/advanced_billing/models/coupon_currency_request.rb +4 -4
  121. data/lib/advanced_billing/models/coupon_currency_response.rb +4 -4
  122. data/lib/advanced_billing/models/coupon_payload.rb +244 -0
  123. data/lib/advanced_billing/models/{create_or_update_coupon.rb → coupon_request.rb} +13 -25
  124. data/lib/advanced_billing/models/coupon_response.rb +4 -4
  125. data/lib/advanced_billing/models/coupon_restriction.rb +7 -7
  126. data/lib/advanced_billing/models/coupon_subcodes.rb +4 -4
  127. data/lib/advanced_billing/models/coupon_subcodes_response.rb +6 -6
  128. data/lib/advanced_billing/models/coupon_usage.rb +7 -7
  129. data/lib/advanced_billing/models/create_allocation.rb +7 -7
  130. data/lib/advanced_billing/models/create_allocation_request.rb +4 -4
  131. data/lib/advanced_billing/models/create_component_price_point.rb +11 -9
  132. data/lib/advanced_billing/models/create_component_price_point_request.rb +4 -4
  133. data/lib/advanced_billing/models/create_component_price_points_request.rb +4 -4
  134. data/lib/advanced_billing/models/create_credit_note_event.rb +7 -7
  135. data/lib/advanced_billing/models/create_currency_price.rb +6 -6
  136. data/lib/advanced_billing/models/create_currency_prices_request.rb +4 -4
  137. data/lib/advanced_billing/models/create_customer.rb +7 -7
  138. data/lib/advanced_billing/models/create_customer_request.rb +4 -4
  139. data/lib/advanced_billing/models/create_debit_note_event.rb +7 -7
  140. data/lib/advanced_billing/models/create_ebb_component.rb +4 -4
  141. data/lib/advanced_billing/models/create_invoice.rb +7 -7
  142. data/lib/advanced_billing/models/create_invoice_address.rb +7 -7
  143. data/lib/advanced_billing/models/create_invoice_coupon.rb +12 -8
  144. data/lib/advanced_billing/models/create_invoice_item.rb +7 -7
  145. data/lib/advanced_billing/models/create_invoice_payment.rb +7 -7
  146. data/lib/advanced_billing/models/create_invoice_payment_application.rb +5 -5
  147. data/lib/advanced_billing/models/create_invoice_payment_request.rb +5 -5
  148. data/lib/advanced_billing/models/create_invoice_request.rb +4 -4
  149. data/lib/advanced_billing/models/create_metadata.rb +5 -5
  150. data/lib/advanced_billing/models/create_metadata_request.rb +4 -4
  151. data/lib/advanced_billing/models/create_metafield.rb +7 -7
  152. data/lib/advanced_billing/models/create_metafields_request.rb +4 -4
  153. data/lib/advanced_billing/models/create_metered_component.rb +4 -4
  154. data/lib/advanced_billing/models/create_multi_invoice_payment.rb +7 -7
  155. data/lib/advanced_billing/models/create_multi_invoice_payment_request.rb +4 -4
  156. data/lib/advanced_billing/models/create_offer.rb +7 -7
  157. data/lib/advanced_billing/models/create_offer_component.rb +6 -6
  158. data/lib/advanced_billing/models/create_offer_request.rb +4 -4
  159. data/lib/advanced_billing/models/create_on_off_component.rb +4 -4
  160. data/lib/advanced_billing/models/create_or_update_endpoint.rb +5 -5
  161. data/lib/advanced_billing/models/create_or_update_endpoint_request.rb +4 -4
  162. data/lib/advanced_billing/models/create_or_update_product.rb +7 -7
  163. data/lib/advanced_billing/models/create_or_update_product_request.rb +4 -4
  164. data/lib/advanced_billing/models/create_or_update_segment_price.rb +6 -6
  165. data/lib/advanced_billing/models/create_payment.rb +7 -7
  166. data/lib/advanced_billing/models/create_payment_profile.rb +7 -7
  167. data/lib/advanced_billing/models/create_payment_profile_request.rb +4 -4
  168. data/lib/advanced_billing/models/create_prepaid_component.rb +4 -4
  169. data/lib/advanced_billing/models/create_prepaid_usage_component_price_point.rb +14 -13
  170. data/lib/advanced_billing/models/create_prepayment.rb +7 -7
  171. data/lib/advanced_billing/models/create_prepayment_request.rb +4 -4
  172. data/lib/advanced_billing/models/create_prepayment_response.rb +4 -4
  173. data/lib/advanced_billing/models/create_product_currency_price.rb +6 -6
  174. data/lib/advanced_billing/models/create_product_currency_prices_request.rb +4 -4
  175. data/lib/advanced_billing/models/create_product_family.rb +6 -6
  176. data/lib/advanced_billing/models/create_product_family_request.rb +4 -4
  177. data/lib/advanced_billing/models/create_product_price_point.rb +7 -7
  178. data/lib/advanced_billing/models/create_product_price_point_request.rb +4 -4
  179. data/lib/advanced_billing/models/create_quantity_based_component.rb +4 -4
  180. data/lib/advanced_billing/models/create_reason_code.rb +6 -6
  181. data/lib/advanced_billing/models/create_reason_code_request.rb +4 -4
  182. data/lib/advanced_billing/models/create_segment.rb +7 -7
  183. data/lib/advanced_billing/models/create_segment_request.rb +4 -4
  184. data/lib/advanced_billing/models/create_subscription.rb +7 -8
  185. data/lib/advanced_billing/models/create_subscription_component.rb +7 -7
  186. data/lib/advanced_billing/models/create_subscription_group.rb +5 -5
  187. data/lib/advanced_billing/models/create_subscription_group_request.rb +4 -4
  188. data/lib/advanced_billing/models/create_subscription_request.rb +4 -4
  189. data/lib/advanced_billing/models/create_usage.rb +7 -7
  190. data/lib/advanced_billing/models/create_usage_request.rb +4 -4
  191. data/lib/advanced_billing/models/created_prepayment.rb +7 -7
  192. data/lib/advanced_billing/models/credit_account_balance_changed.rb +7 -7
  193. data/lib/advanced_billing/models/credit_card_attributes.rb +6 -6
  194. data/lib/advanced_billing/models/credit_card_payment_profile.rb +7 -7
  195. data/lib/advanced_billing/models/credit_note.rb +7 -7
  196. data/lib/advanced_billing/models/credit_note_application.rb +7 -7
  197. data/lib/advanced_billing/models/credit_note_line_item.rb +7 -7
  198. data/lib/advanced_billing/models/credit_scheme_request.rb +4 -4
  199. data/lib/advanced_billing/models/currency_price.rb +27 -7
  200. data/lib/advanced_billing/models/currency_prices_response.rb +4 -4
  201. data/lib/advanced_billing/models/custom_field_value_change.rb +7 -7
  202. data/lib/advanced_billing/models/customer.rb +7 -7
  203. data/lib/advanced_billing/models/customer_attributes.rb +7 -7
  204. data/lib/advanced_billing/models/customer_change.rb +7 -7
  205. data/lib/advanced_billing/models/customer_changes_preview_response.rb +4 -4
  206. data/lib/advanced_billing/models/customer_custom_fields_change.rb +5 -5
  207. data/lib/advanced_billing/models/customer_error.rb +4 -4
  208. data/lib/advanced_billing/models/customer_payer_change.rb +5 -5
  209. data/lib/advanced_billing/models/customer_response.rb +4 -4
  210. data/lib/advanced_billing/models/debit_note.rb +7 -7
  211. data/lib/advanced_billing/models/deduct_service_credit.rb +5 -5
  212. data/lib/advanced_billing/models/deduct_service_credit_request.rb +4 -4
  213. data/lib/advanced_billing/models/delayed_cancellation_response.rb +4 -4
  214. data/lib/advanced_billing/models/delete_subscription_group_response.rb +5 -5
  215. data/lib/advanced_billing/models/dunner_data.rb +7 -7
  216. data/lib/advanced_billing/models/dunning_step_data.rb +7 -7
  217. data/lib/advanced_billing/models/dunning_step_reached.rb +6 -6
  218. data/lib/advanced_billing/models/ebb_component.rb +17 -53
  219. data/lib/advanced_billing/models/ebb_event.rb +4 -4
  220. data/lib/advanced_billing/models/enable_webhooks_request.rb +4 -4
  221. data/lib/advanced_billing/models/enable_webhooks_response.rb +4 -4
  222. data/lib/advanced_billing/models/endpoint.rb +7 -7
  223. data/lib/advanced_billing/models/endpoint_response.rb +4 -4
  224. data/lib/advanced_billing/models/errors.rb +5 -5
  225. data/lib/advanced_billing/models/event.rb +71 -11
  226. data/lib/advanced_billing/models/event_based_billing_segment_error.rb +4 -4
  227. data/lib/advanced_billing/models/event_key.rb +264 -0
  228. data/lib/advanced_billing/models/event_response.rb +4 -4
  229. data/lib/advanced_billing/models/failed_payment_event.rb +7 -7
  230. data/lib/advanced_billing/models/failed_payment_event_data.rb +7 -7
  231. data/lib/advanced_billing/models/full_subscription_group_response.rb +7 -7
  232. data/lib/advanced_billing/models/get_one_time_token_payment_profile.rb +7 -7
  233. data/lib/advanced_billing/models/get_one_time_token_request.rb +4 -4
  234. data/lib/advanced_billing/models/group_billing.rb +6 -6
  235. data/lib/advanced_billing/models/group_settings.rb +5 -5
  236. data/lib/advanced_billing/models/group_target.rb +5 -5
  237. data/lib/advanced_billing/models/historic_usage.rb +6 -6
  238. data/lib/advanced_billing/models/invoice.rb +52 -13
  239. data/lib/advanced_billing/models/invoice_address.rb +7 -7
  240. data/lib/advanced_billing/models/invoice_avatax_details.rb +130 -0
  241. data/lib/advanced_billing/models/invoice_balance_item.rb +6 -6
  242. data/lib/advanced_billing/models/invoice_credit.rb +7 -7
  243. data/lib/advanced_billing/models/invoice_custom_field.rb +7 -7
  244. data/lib/advanced_billing/models/invoice_customer.rb +7 -7
  245. data/lib/advanced_billing/models/invoice_debit.rb +148 -0
  246. data/lib/advanced_billing/models/invoice_discount.rb +7 -7
  247. data/lib/advanced_billing/models/invoice_discount_breakout.rb +6 -6
  248. data/lib/advanced_billing/models/invoice_display_settings.rb +7 -7
  249. data/lib/advanced_billing/models/invoice_issued.rb +7 -7
  250. data/lib/advanced_billing/models/invoice_line_item.rb +21 -8
  251. data/lib/advanced_billing/models/invoice_line_item_component_cost_data.rb +4 -4
  252. data/lib/advanced_billing/models/invoice_line_item_event_data.rb +7 -7
  253. data/lib/advanced_billing/models/invoice_line_item_pricing_detail.rb +5 -5
  254. data/lib/advanced_billing/models/invoice_payer.rb +7 -7
  255. data/lib/advanced_billing/models/invoice_payer_change.rb +7 -7
  256. data/lib/advanced_billing/models/invoice_payment.rb +7 -7
  257. data/lib/advanced_billing/models/invoice_payment_application.rb +6 -6
  258. data/lib/advanced_billing/models/invoice_payment_method.rb +7 -7
  259. data/lib/advanced_billing/models/invoice_pre_payment.rb +6 -6
  260. data/lib/advanced_billing/models/invoice_previous_balance.rb +5 -5
  261. data/lib/advanced_billing/models/invoice_refund.rb +7 -7
  262. data/lib/advanced_billing/models/invoice_response.rb +4 -4
  263. data/lib/advanced_billing/models/invoice_seller.rb +7 -7
  264. data/lib/advanced_billing/models/invoice_status.rb +4 -1
  265. data/lib/advanced_billing/models/invoice_tax.rb +7 -7
  266. data/lib/advanced_billing/models/invoice_tax_breakout.rb +7 -7
  267. data/lib/advanced_billing/models/invoice_tax_component_breakout.rb +7 -7
  268. data/lib/advanced_billing/models/issue_advance_invoice_request.rb +4 -4
  269. data/lib/advanced_billing/models/issue_invoice_event.rb +7 -7
  270. data/lib/advanced_billing/models/issue_invoice_event_data.rb +7 -7
  271. data/lib/advanced_billing/models/issue_invoice_request.rb +4 -4
  272. data/lib/advanced_billing/models/issue_service_credit.rb +5 -5
  273. data/lib/advanced_billing/models/issue_service_credit_request.rb +4 -4
  274. data/lib/advanced_billing/models/item_price_point_changed.rb +7 -7
  275. data/lib/advanced_billing/models/item_price_point_data.rb +6 -6
  276. data/lib/advanced_billing/models/list_components_filter.rb +5 -5
  277. data/lib/advanced_billing/models/list_components_price_points_response.rb +4 -4
  278. data/lib/advanced_billing/models/list_coupons_filter.rb +7 -7
  279. data/lib/advanced_billing/models/list_credit_notes_response.rb +4 -4
  280. data/lib/advanced_billing/models/list_invoice_events_response.rb +7 -7
  281. data/lib/advanced_billing/models/list_invoices_response.rb +4 -4
  282. data/lib/advanced_billing/models/list_metafields_response.rb +7 -7
  283. data/lib/advanced_billing/models/list_mrr_filter.rb +4 -4
  284. data/lib/advanced_billing/models/list_mrr_response.rb +4 -4
  285. data/lib/advanced_billing/models/list_mrr_response_result.rb +7 -7
  286. data/lib/advanced_billing/models/list_offers_response.rb +4 -4
  287. data/lib/advanced_billing/models/list_prepayments_filter.rb +6 -6
  288. data/lib/advanced_billing/models/list_price_points_filter.rb +7 -7
  289. data/lib/advanced_billing/models/list_product_price_points_response.rb +4 -4
  290. data/lib/advanced_billing/models/list_products_filter.rb +7 -7
  291. data/lib/advanced_billing/models/list_proforma_invoices_meta.rb +7 -7
  292. data/lib/advanced_billing/models/list_proforma_invoices_response.rb +5 -5
  293. data/lib/advanced_billing/models/list_public_keys_meta.rb +7 -7
  294. data/lib/advanced_billing/models/list_public_keys_response.rb +5 -5
  295. data/lib/advanced_billing/models/list_sale_rep_item.rb +7 -7
  296. data/lib/advanced_billing/models/list_segments_filter.rb +7 -7
  297. data/lib/advanced_billing/models/list_segments_response.rb +4 -4
  298. data/lib/advanced_billing/models/list_subcription_group_prepayment_item.rb +7 -7
  299. data/lib/advanced_billing/models/list_subscription_components_filter.rb +5 -5
  300. data/lib/advanced_billing/models/list_subscription_components_for_site_filter.rb +6 -6
  301. data/lib/advanced_billing/models/list_subscription_components_response.rb +4 -4
  302. data/lib/advanced_billing/models/list_subscription_group_prepayment.rb +4 -4
  303. data/lib/advanced_billing/models/list_subscription_group_prepayment_response.rb +4 -4
  304. data/lib/advanced_billing/models/list_subscription_groups_item.rb +7 -7
  305. data/lib/advanced_billing/models/list_subscription_groups_meta.rb +5 -5
  306. data/lib/advanced_billing/models/list_subscription_groups_response.rb +5 -5
  307. data/lib/advanced_billing/models/metadata.rb +7 -7
  308. data/lib/advanced_billing/models/metafield.rb +7 -7
  309. data/lib/advanced_billing/models/metafield_scope.rb +7 -7
  310. data/lib/advanced_billing/models/metered_component.rb +22 -51
  311. data/lib/advanced_billing/models/metered_usage.rb +7 -7
  312. data/lib/advanced_billing/models/movement.rb +7 -7
  313. data/lib/advanced_billing/models/movement_line_item.rb +7 -7
  314. data/lib/advanced_billing/models/mrr.rb +7 -7
  315. data/lib/advanced_billing/models/mrr_movement.rb +7 -7
  316. data/lib/advanced_billing/models/mrr_response.rb +4 -4
  317. data/lib/advanced_billing/models/multi_invoice_payment.rb +7 -7
  318. data/lib/advanced_billing/models/multi_invoice_payment_response.rb +4 -4
  319. data/lib/advanced_billing/models/nested_subscription_group.rb +7 -7
  320. data/lib/advanced_billing/models/net_terms.rb +7 -7
  321. data/lib/advanced_billing/models/offer.rb +7 -7
  322. data/lib/advanced_billing/models/offer_discount.rb +6 -6
  323. data/lib/advanced_billing/models/offer_item.rb +7 -7
  324. data/lib/advanced_billing/models/offer_response.rb +4 -4
  325. data/lib/advanced_billing/models/offer_signup_page.rb +7 -7
  326. data/lib/advanced_billing/models/{reason_codes_json_response.rb → ok_response.rb} +7 -7
  327. data/lib/advanced_billing/models/on_off_component.rb +40 -61
  328. data/lib/advanced_billing/models/organization_address.rb +7 -7
  329. data/lib/advanced_billing/models/origin_invoice.rb +5 -5
  330. data/lib/advanced_billing/models/overage_pricing.rb +5 -5
  331. data/lib/advanced_billing/models/override_subscription.rb +7 -7
  332. data/lib/advanced_billing/models/override_subscription_request.rb +4 -4
  333. data/lib/advanced_billing/models/paginated_metadata.rb +7 -7
  334. data/lib/advanced_billing/models/paid_invoice.rb +7 -7
  335. data/lib/advanced_billing/models/pause_request.rb +4 -4
  336. data/lib/advanced_billing/models/payer_attributes.rb +7 -7
  337. data/lib/advanced_billing/models/payer_error.rb +6 -6
  338. data/lib/advanced_billing/models/payment_collection_method_changed.rb +5 -5
  339. data/lib/advanced_billing/models/payment_for_allocation.rb +7 -7
  340. data/lib/advanced_billing/models/payment_method_apple_pay.rb +4 -4
  341. data/lib/advanced_billing/models/payment_method_bank_account.rb +6 -6
  342. data/lib/advanced_billing/models/payment_method_credit_card.rb +7 -7
  343. data/lib/advanced_billing/models/payment_method_external.rb +7 -7
  344. data/lib/advanced_billing/models/payment_method_paypal.rb +5 -5
  345. data/lib/advanced_billing/models/payment_profile_attributes.rb +7 -7
  346. data/lib/advanced_billing/models/payment_profile_response.rb +4 -4
  347. data/lib/advanced_billing/models/payment_related_events.rb +5 -5
  348. data/lib/advanced_billing/models/paypal_payment_profile.rb +7 -7
  349. data/lib/advanced_billing/models/pending_cancellation_change.rb +5 -5
  350. data/lib/advanced_billing/models/portal_management_link.rb +7 -7
  351. data/lib/advanced_billing/models/prepaid_configuration.rb +7 -7
  352. data/lib/advanced_billing/models/prepaid_configuration_response.rb +4 -4
  353. data/lib/advanced_billing/models/prepaid_product_price_point_filter.rb +4 -4
  354. data/lib/advanced_billing/models/prepaid_subscription_balance_changed.rb +7 -7
  355. data/lib/advanced_billing/models/prepaid_usage.rb +7 -7
  356. data/lib/advanced_billing/models/prepaid_usage_allocation_detail.rb +6 -6
  357. data/lib/advanced_billing/models/prepaid_usage_component.rb +48 -41
  358. data/lib/advanced_billing/models/prepayment.rb +7 -7
  359. data/lib/advanced_billing/models/prepayment_account_balance_changed.rb +7 -7
  360. data/lib/advanced_billing/models/prepayment_response.rb +4 -4
  361. data/lib/advanced_billing/models/prepayments_response.rb +4 -4
  362. data/lib/advanced_billing/models/preview_allocations_request.rb +7 -7
  363. data/lib/advanced_billing/models/price.rb +6 -6
  364. data/lib/advanced_billing/models/product.rb +7 -7
  365. data/lib/advanced_billing/models/product_family.rb +7 -7
  366. data/lib/advanced_billing/models/product_family_response.rb +4 -4
  367. data/lib/advanced_billing/models/product_price_point.rb +7 -7
  368. data/lib/advanced_billing/models/product_price_point_errors.rb +7 -7
  369. data/lib/advanced_billing/models/product_price_point_response.rb +4 -4
  370. data/lib/advanced_billing/models/product_response.rb +4 -4
  371. data/lib/advanced_billing/models/proforma_error.rb +4 -4
  372. data/lib/advanced_billing/models/proforma_invoice.rb +7 -7
  373. data/lib/advanced_billing/models/proforma_invoice_credit.rb +7 -7
  374. data/lib/advanced_billing/models/proforma_invoice_discount.rb +7 -7
  375. data/lib/advanced_billing/models/proforma_invoice_issued.rb +7 -7
  376. data/lib/advanced_billing/models/proforma_invoice_payment.rb +7 -7
  377. data/lib/advanced_billing/models/proforma_invoice_tax.rb +7 -7
  378. data/lib/advanced_billing/models/proration.rb +4 -4
  379. data/lib/advanced_billing/models/public_key.rb +6 -6
  380. data/lib/advanced_billing/models/public_signup_page.rb +7 -7
  381. data/lib/advanced_billing/models/quantity_based_component.rb +21 -23
  382. data/lib/advanced_billing/models/reactivate_subscription_group_request.rb +5 -5
  383. data/lib/advanced_billing/models/reactivate_subscription_group_response.rb +7 -7
  384. data/lib/advanced_billing/models/reactivate_subscription_request.rb +7 -7
  385. data/lib/advanced_billing/models/reactivation_billing.rb +4 -4
  386. data/lib/advanced_billing/models/reason_code.rb +7 -7
  387. data/lib/advanced_billing/models/reason_code_response.rb +4 -4
  388. data/lib/advanced_billing/models/record_payment_request.rb +4 -4
  389. data/lib/advanced_billing/models/record_payment_response.rb +5 -5
  390. data/lib/advanced_billing/models/referral_code.rb +7 -7
  391. data/lib/advanced_billing/models/referral_validation_response.rb +4 -4
  392. data/lib/advanced_billing/models/refund_consolidated_invoice.rb +7 -7
  393. data/lib/advanced_billing/models/refund_invoice.rb +7 -7
  394. data/lib/advanced_billing/models/refund_invoice_event.rb +7 -7
  395. data/lib/advanced_billing/models/refund_invoice_event_data.rb +7 -7
  396. data/lib/advanced_billing/models/refund_invoice_request.rb +4 -4
  397. data/lib/advanced_billing/models/refund_prepayment.rb +7 -7
  398. data/lib/advanced_billing/models/refund_prepayment_base_refund_error.rb +4 -4
  399. data/lib/advanced_billing/models/refund_prepayment_request.rb +4 -4
  400. data/lib/advanced_billing/models/refund_success.rb +6 -6
  401. data/lib/advanced_billing/models/remove_payment_event.rb +7 -7
  402. data/lib/advanced_billing/models/remove_payment_event_data.rb +7 -7
  403. data/lib/advanced_billing/models/renewal_preview.rb +7 -7
  404. data/lib/advanced_billing/models/renewal_preview_component.rb +6 -6
  405. data/lib/advanced_billing/models/renewal_preview_line_item.rb +7 -7
  406. data/lib/advanced_billing/models/renewal_preview_request.rb +4 -4
  407. data/lib/advanced_billing/models/renewal_preview_response.rb +4 -4
  408. data/lib/advanced_billing/models/replay_webhooks_request.rb +4 -4
  409. data/lib/advanced_billing/models/replay_webhooks_response.rb +4 -4
  410. data/lib/advanced_billing/models/resent_invitation.rb +7 -7
  411. data/lib/advanced_billing/models/resume_options.rb +5 -5
  412. data/lib/advanced_billing/models/revoked_invitation.rb +6 -6
  413. data/lib/advanced_billing/models/sale_rep.rb +7 -7
  414. data/lib/advanced_billing/models/sale_rep_item_mrr.rb +6 -6
  415. data/lib/advanced_billing/models/sale_rep_settings.rb +7 -7
  416. data/lib/advanced_billing/models/sale_rep_subscription.rb +7 -7
  417. data/lib/advanced_billing/models/segment.rb +7 -7
  418. data/lib/advanced_billing/models/segment_price.rb +7 -7
  419. data/lib/advanced_billing/models/segment_response.rb +4 -4
  420. data/lib/advanced_billing/models/send_invoice_request.rb +6 -6
  421. data/lib/advanced_billing/models/service_credit.rb +7 -7
  422. data/lib/advanced_billing/models/service_credit_response.rb +4 -4
  423. data/lib/advanced_billing/models/signup_proforma_preview.rb +5 -5
  424. data/lib/advanced_billing/models/signup_proforma_preview_response.rb +4 -4
  425. data/lib/advanced_billing/models/site.rb +7 -7
  426. data/lib/advanced_billing/models/site_response.rb +4 -4
  427. data/lib/advanced_billing/models/site_statistics.rb +7 -7
  428. data/lib/advanced_billing/models/site_summary.rb +7 -7
  429. data/lib/advanced_billing/models/subscription.rb +7 -7
  430. data/lib/advanced_billing/models/subscription_component.rb +7 -7
  431. data/lib/advanced_billing/models/subscription_component_allocation_error_item.rb +5 -5
  432. data/lib/advanced_billing/models/subscription_component_response.rb +4 -4
  433. data/lib/advanced_billing/models/subscription_component_subscription.rb +5 -5
  434. data/lib/advanced_billing/models/subscription_custom_price.rb +7 -7
  435. data/lib/advanced_billing/models/subscription_filter.rb +7 -7
  436. data/lib/advanced_billing/models/subscription_group.rb +7 -7
  437. data/lib/advanced_billing/models/subscription_group_balances.rb +7 -7
  438. data/lib/advanced_billing/models/subscription_group_bank_account.rb +7 -7
  439. data/lib/advanced_billing/models/subscription_group_component_custom_price.rb +6 -6
  440. data/lib/advanced_billing/models/subscription_group_credit_card.rb +7 -7
  441. data/lib/advanced_billing/models/subscription_group_customer.rb +7 -7
  442. data/lib/advanced_billing/models/subscription_group_item.rb +7 -7
  443. data/lib/advanced_billing/models/subscription_group_members_array_error.rb +4 -4
  444. data/lib/advanced_billing/models/subscription_group_payment_profile.rb +7 -7
  445. data/lib/advanced_billing/models/subscription_group_prepayment.rb +7 -7
  446. data/lib/advanced_billing/models/subscription_group_prepayment_request.rb +4 -4
  447. data/lib/advanced_billing/models/subscription_group_prepayment_response.rb +7 -7
  448. data/lib/advanced_billing/models/subscription_group_response.rb +4 -4
  449. data/lib/advanced_billing/models/subscription_group_signup.rb +7 -7
  450. data/lib/advanced_billing/models/subscription_group_signup_component.rb +7 -7
  451. data/lib/advanced_billing/models/subscription_group_signup_error.rb +7 -7
  452. data/lib/advanced_billing/models/{subscription_group_signup_success.rb → subscription_group_signup_event_data.rb} +17 -15
  453. data/lib/advanced_billing/models/subscription_group_signup_failure_data.rb +7 -7
  454. data/lib/advanced_billing/models/subscription_group_signup_item.rb +7 -7
  455. data/lib/advanced_billing/models/subscription_group_signup_request.rb +4 -4
  456. data/lib/advanced_billing/models/subscription_group_signup_response.rb +7 -7
  457. data/lib/advanced_billing/models/subscription_group_single_error.rb +4 -4
  458. data/lib/advanced_billing/models/subscription_group_subscription_error.rb +7 -7
  459. data/lib/advanced_billing/models/subscription_group_update_error.rb +6 -15
  460. data/lib/advanced_billing/models/subscription_included_coupon.rb +7 -7
  461. data/lib/advanced_billing/models/subscription_migration_preview.rb +7 -7
  462. data/lib/advanced_billing/models/subscription_migration_preview_options.rb +7 -7
  463. data/lib/advanced_billing/models/subscription_migration_preview_request.rb +4 -4
  464. data/lib/advanced_billing/models/subscription_migration_preview_response.rb +4 -4
  465. data/lib/advanced_billing/models/subscription_mrr.rb +6 -6
  466. data/lib/advanced_billing/models/subscription_mrr_breakout.rb +5 -5
  467. data/lib/advanced_billing/models/subscription_mrr_response.rb +4 -4
  468. data/lib/advanced_billing/models/subscription_note.rb +7 -7
  469. data/lib/advanced_billing/models/subscription_note_response.rb +4 -4
  470. data/lib/advanced_billing/models/subscription_preview.rb +5 -5
  471. data/lib/advanced_billing/models/subscription_preview_response.rb +4 -4
  472. data/lib/advanced_billing/models/subscription_product_change.rb +5 -5
  473. data/lib/advanced_billing/models/subscription_product_migration.rb +7 -7
  474. data/lib/advanced_billing/models/subscription_product_migration_request.rb +4 -4
  475. data/lib/advanced_billing/models/subscription_response.rb +4 -4
  476. data/lib/advanced_billing/models/subscription_state_change.rb +5 -5
  477. data/lib/advanced_billing/models/tax_configuration.rb +6 -6
  478. data/lib/advanced_billing/models/too_many_management_link_requests.rb +5 -5
  479. data/lib/advanced_billing/models/update_allocation_expiration_date.rb +4 -4
  480. data/lib/advanced_billing/models/update_component.rb +7 -7
  481. data/lib/advanced_billing/models/update_component_price_point.rb +7 -7
  482. data/lib/advanced_billing/models/update_component_price_point_request.rb +4 -4
  483. data/lib/advanced_billing/models/update_component_request.rb +4 -4
  484. data/lib/advanced_billing/models/update_coupon_currency.rb +5 -5
  485. data/lib/advanced_billing/models/update_currency_price.rb +6 -6
  486. data/lib/advanced_billing/models/update_currency_prices_request.rb +4 -4
  487. data/lib/advanced_billing/models/update_customer.rb +7 -7
  488. data/lib/advanced_billing/models/update_customer_request.rb +4 -4
  489. data/lib/advanced_billing/models/update_metadata.rb +6 -6
  490. data/lib/advanced_billing/models/update_metadata_request.rb +4 -4
  491. data/lib/advanced_billing/models/update_metafield.rb +7 -7
  492. data/lib/advanced_billing/models/update_metafields_request.rb +4 -4
  493. data/lib/advanced_billing/models/update_payment_profile.rb +7 -7
  494. data/lib/advanced_billing/models/update_payment_profile_request.rb +4 -4
  495. data/lib/advanced_billing/models/update_price.rb +7 -7
  496. data/lib/advanced_billing/models/update_product_price_point.rb +5 -5
  497. data/lib/advanced_billing/models/update_product_price_point_request.rb +4 -4
  498. data/lib/advanced_billing/models/update_reason_code.rb +6 -6
  499. data/lib/advanced_billing/models/update_reason_code_request.rb +4 -4
  500. data/lib/advanced_billing/models/update_segment.rb +5 -5
  501. data/lib/advanced_billing/models/update_segment_request.rb +4 -4
  502. data/lib/advanced_billing/models/update_subscription.rb +7 -8
  503. data/lib/advanced_billing/models/update_subscription_component.rb +5 -5
  504. data/lib/advanced_billing/models/update_subscription_group.rb +4 -4
  505. data/lib/advanced_billing/models/update_subscription_group_request.rb +4 -4
  506. data/lib/advanced_billing/models/update_subscription_note.rb +5 -5
  507. data/lib/advanced_billing/models/update_subscription_note_request.rb +4 -4
  508. data/lib/advanced_billing/models/update_subscription_request.rb +4 -4
  509. data/lib/advanced_billing/models/upsert_prepaid_configuration.rb +7 -7
  510. data/lib/advanced_billing/models/upsert_prepaid_configuration_request.rb +4 -4
  511. data/lib/advanced_billing/models/usage.rb +7 -7
  512. data/lib/advanced_billing/models/usage_response.rb +4 -4
  513. data/lib/advanced_billing/models/void_invoice.rb +4 -4
  514. data/lib/advanced_billing/models/void_invoice_event.rb +7 -7
  515. data/lib/advanced_billing/models/void_invoice_event_data.rb +7 -7
  516. data/lib/advanced_billing/models/void_invoice_request.rb +4 -4
  517. data/lib/advanced_billing/models/void_remainder_event.rb +7 -7
  518. data/lib/advanced_billing/models/void_remainder_event_data.rb +7 -7
  519. data/lib/advanced_billing/models/webhook.rb +7 -7
  520. data/lib/advanced_billing/models/webhook_response.rb +4 -4
  521. data/lib/advanced_billing/utilities/union_type_lookup.rb +12 -33
  522. data/lib/advanced_billing.rb +9 -11
  523. metadata +12 -14
  524. data/lib/advanced_billing/models/create_or_update_flat_amount_coupon.rb +0 -249
  525. data/lib/advanced_billing/models/create_or_update_percentage_coupon.rb +0 -250
  526. data/lib/advanced_billing/models/event_type.rb +0 -121
  527. data/lib/advanced_billing/models/prepaid_component_price_point.rb +0 -123
  528. data/lib/advanced_billing/models/subscription_group_member_error.rb +0 -78
  529. data/lib/advanced_billing/models/subscription_group_signup_failure.rb +0 -93
  530. data/lib/advanced_billing/models/subscription_group_signup_success_data.rb +0 -185
@@ -30,14 +30,6 @@ module AdvancedBilling
30
30
  # @return [TrueClass | FalseClass]
31
31
  attr_accessor :taxable
32
32
 
33
- # (Not required for ‘per_unit’ pricing schemes) One or more price brackets.
34
- # See [Price Bracket
35
- # Rules](https://maxio.zendesk.com/hc/en-us/articles/24261191737101-Price-Po
36
- # ints-Components) for an overview of how price brackets work for different
37
- # pricing schemes.
38
- # @return [Array[Price]]
39
- attr_accessor :prices
40
-
41
33
  # The type of credit to be created when upgrading/downgrading. Defaults to
42
34
  # the component and then site setting if one is not provided.
43
35
  # Available values: `full`, `prorated`, `none`.
@@ -56,11 +48,9 @@ module AdvancedBilling
56
48
  # @return [Array[ComponentPricePointItem]]
57
49
  attr_accessor :price_points
58
50
 
59
- # The amount the customer will be charged per unit when the pricing scheme
60
- # is “per_unit”. For On/Off Components, this is the amount that the customer
61
- # will be charged when they turn the component on for the subscription. The
62
- # price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or
63
- # 0.00000065
51
+ # This is the amount that the customer will be charged when they turn the
52
+ # component on for the subscription. The price can contain up to 8 decimal
53
+ # places. i.e. 1.00 or 0.0012 or 0.00000065
64
54
  # @return [Object]
65
55
  attr_accessor :unit_price
66
56
 
@@ -76,19 +66,21 @@ module AdvancedBilling
76
66
  # @return [TrueClass | FalseClass]
77
67
  attr_accessor :hide_date_range_on_invoice
78
68
 
79
- # deprecated May 2011 - use unit_price instead
80
- # @return [String]
81
- attr_accessor :price_in_cents
82
-
83
- # deprecated May 2011 - use unit_price instead
69
+ # (Only available on Relationship Invoicing sites) Boolean flag describing
70
+ # if the service date range should show for the component on generated
71
+ # invoices.
84
72
  # @return [TrueClass | FalseClass]
85
73
  attr_accessor :display_on_hosted_page
86
74
 
87
- # deprecated May 2011 - use unit_price instead
75
+ # (Only available on Relationship Invoicing sites) Boolean flag describing
76
+ # if the service date range should show for the component on generated
77
+ # invoices.
88
78
  # @return [TrueClass | FalseClass]
89
79
  attr_accessor :allow_fractional_quantities
90
80
 
91
- # deprecated May 2011 - use unit_price instead
81
+ # (Only available on Relationship Invoicing sites) Boolean flag describing
82
+ # if the service date range should show for the component on generated
83
+ # invoices.
92
84
  # @return [Array[Integer]]
93
85
  attr_accessor :public_signup_page_ids
94
86
 
@@ -112,14 +104,12 @@ module AdvancedBilling
112
104
  @_hash['description'] = 'description'
113
105
  @_hash['handle'] = 'handle'
114
106
  @_hash['taxable'] = 'taxable'
115
- @_hash['prices'] = 'prices'
116
107
  @_hash['upgrade_charge'] = 'upgrade_charge'
117
108
  @_hash['downgrade_credit'] = 'downgrade_credit'
118
109
  @_hash['price_points'] = 'price_points'
119
110
  @_hash['unit_price'] = 'unit_price'
120
111
  @_hash['tax_code'] = 'tax_code'
121
112
  @_hash['hide_date_range_on_invoice'] = 'hide_date_range_on_invoice'
122
- @_hash['price_in_cents'] = 'price_in_cents'
123
113
  @_hash['display_on_hosted_page'] = 'display_on_hosted_page'
124
114
  @_hash['allow_fractional_quantities'] = 'allow_fractional_quantities'
125
115
  @_hash['public_signup_page_ids'] = 'public_signup_page_ids'
@@ -134,14 +124,11 @@ module AdvancedBilling
134
124
  description
135
125
  handle
136
126
  taxable
137
- prices
138
127
  upgrade_charge
139
128
  downgrade_credit
140
129
  price_points
141
- unit_price
142
130
  tax_code
143
131
  hide_date_range_on_invoice
144
- price_in_cents
145
132
  display_on_hosted_page
146
133
  allow_fractional_quantities
147
134
  public_signup_page_ids
@@ -159,29 +146,32 @@ module AdvancedBilling
159
146
  ]
160
147
  end
161
148
 
162
- def initialize(name:, description: SKIP, handle: SKIP, taxable: SKIP,
163
- prices: SKIP, upgrade_charge: SKIP, downgrade_credit: SKIP,
164
- price_points: SKIP, unit_price: SKIP, tax_code: SKIP,
165
- hide_date_range_on_invoice: SKIP, price_in_cents: SKIP,
149
+ def initialize(name:, unit_price:, description: SKIP, handle: SKIP,
150
+ taxable: SKIP, upgrade_charge: SKIP, downgrade_credit: SKIP,
151
+ price_points: SKIP, tax_code: SKIP,
152
+ hide_date_range_on_invoice: SKIP,
166
153
  display_on_hosted_page: SKIP,
167
154
  allow_fractional_quantities: SKIP,
168
155
  public_signup_page_ids: SKIP, interval: SKIP,
169
156
  interval_unit: SKIP, additional_properties: {})
157
+ # Add additional model properties to the instance.
158
+ additional_properties.each do |_name, _value|
159
+ instance_variable_set("@#{_name}", _value)
160
+ end
161
+
170
162
  @name = name
171
163
  @description = description unless description == SKIP
172
164
  @handle = handle unless handle == SKIP
173
165
  @taxable = taxable unless taxable == SKIP
174
- @prices = prices unless prices == SKIP
175
166
  @upgrade_charge = upgrade_charge unless upgrade_charge == SKIP
176
167
  @downgrade_credit = downgrade_credit unless downgrade_credit == SKIP
177
168
  @price_points = price_points unless price_points == SKIP
178
- @unit_price = unit_price unless unit_price == SKIP
169
+ @unit_price = unit_price
179
170
  @tax_code = tax_code unless tax_code == SKIP
180
171
  unless hide_date_range_on_invoice == SKIP
181
172
  @hide_date_range_on_invoice =
182
173
  hide_date_range_on_invoice
183
174
  end
184
- @price_in_cents = price_in_cents unless price_in_cents == SKIP
185
175
  @display_on_hosted_page = display_on_hosted_page unless display_on_hosted_page == SKIP
186
176
  unless allow_fractional_quantities == SKIP
187
177
  @allow_fractional_quantities =
@@ -190,11 +180,6 @@ module AdvancedBilling
190
180
  @public_signup_page_ids = public_signup_page_ids unless public_signup_page_ids == SKIP
191
181
  @interval = interval unless interval == SKIP
192
182
  @interval_unit = interval_unit unless interval_unit == SKIP
193
-
194
- # Add additional model properties to the instance.
195
- additional_properties.each do |_name, _value|
196
- instance_variable_set("@#{_name}", _value)
197
- end
198
183
  end
199
184
 
200
185
  # Creates an instance of the object from a hash.
@@ -203,19 +188,12 @@ module AdvancedBilling
203
188
 
204
189
  # Extract variables from the hash.
205
190
  name = hash.key?('name') ? hash['name'] : nil
191
+ unit_price = hash.key?('unit_price') ? APIHelper.deserialize_union_type(
192
+ UnionTypeLookUp.get(:OnOffComponentUnitPrice), hash['unit_price']
193
+ ) : nil
206
194
  description = hash.key?('description') ? hash['description'] : SKIP
207
195
  handle = hash.key?('handle') ? hash['handle'] : SKIP
208
196
  taxable = hash.key?('taxable') ? hash['taxable'] : SKIP
209
- # Parameter is an array, so we need to iterate through it
210
- prices = nil
211
- unless hash['prices'].nil?
212
- prices = []
213
- hash['prices'].each do |structure|
214
- prices << (Price.from_hash(structure) if structure)
215
- end
216
- end
217
-
218
- prices = SKIP unless hash.key?('prices')
219
197
  upgrade_charge =
220
198
  hash.key?('upgrade_charge') ? hash['upgrade_charge'] : SKIP
221
199
  downgrade_credit =
@@ -230,14 +208,9 @@ module AdvancedBilling
230
208
  end
231
209
 
232
210
  price_points = SKIP unless hash.key?('price_points')
233
- unit_price = hash.key?('unit_price') ? APIHelper.deserialize_union_type(
234
- UnionTypeLookUp.get(:OnOffComponentUnitPrice), hash['unit_price']
235
- ) : SKIP
236
211
  tax_code = hash.key?('tax_code') ? hash['tax_code'] : SKIP
237
212
  hide_date_range_on_invoice =
238
213
  hash.key?('hide_date_range_on_invoice') ? hash['hide_date_range_on_invoice'] : SKIP
239
- price_in_cents =
240
- hash.key?('price_in_cents') ? hash['price_in_cents'] : SKIP
241
214
  display_on_hosted_page =
242
215
  hash.key?('display_on_hosted_page') ? hash['display_on_hosted_page'] : SKIP
243
216
  allow_fractional_quantities =
@@ -248,41 +221,47 @@ module AdvancedBilling
248
221
  interval_unit = hash.key?('interval_unit') ? hash['interval_unit'] : SKIP
249
222
 
250
223
  # Clean out expected properties from Hash.
251
- names.each_value { |k| hash.delete(k) }
224
+ additional_properties = hash.reject { |k, _| names.value?(k) }
252
225
 
253
226
  # Create object from extracted values.
254
227
  OnOffComponent.new(name: name,
228
+ unit_price: unit_price,
255
229
  description: description,
256
230
  handle: handle,
257
231
  taxable: taxable,
258
- prices: prices,
259
232
  upgrade_charge: upgrade_charge,
260
233
  downgrade_credit: downgrade_credit,
261
234
  price_points: price_points,
262
- unit_price: unit_price,
263
235
  tax_code: tax_code,
264
236
  hide_date_range_on_invoice: hide_date_range_on_invoice,
265
- price_in_cents: price_in_cents,
266
237
  display_on_hosted_page: display_on_hosted_page,
267
238
  allow_fractional_quantities: allow_fractional_quantities,
268
239
  public_signup_page_ids: public_signup_page_ids,
269
240
  interval: interval,
270
241
  interval_unit: interval_unit,
271
- additional_properties: hash)
242
+ additional_properties: additional_properties)
272
243
  end
273
244
 
274
245
  # Validates an instance of the object from a given value.
275
246
  # @param [OnOffComponent | Hash] The value against the validation is performed.
276
247
  def self.validate(value)
277
248
  if value.instance_of? self
278
- return APIHelper.valid_type?(value.name,
279
- ->(val) { val.instance_of? String })
249
+ return (
250
+ APIHelper.valid_type?(value.name,
251
+ ->(val) { val.instance_of? String }) and
252
+ UnionTypeLookUp.get(:OnOffComponentUnitPrice)
253
+ .validate(value.unit_price)
254
+ )
280
255
  end
281
256
 
282
257
  return false unless value.instance_of? Hash
283
258
 
284
- APIHelper.valid_type?(value['name'],
285
- ->(val) { val.instance_of? String })
259
+ (
260
+ APIHelper.valid_type?(value['name'],
261
+ ->(val) { val.instance_of? String }) and
262
+ UnionTypeLookUp.get(:OnOffComponentUnitPrice)
263
+ .validate(value['unit_price'])
264
+ )
286
265
  end
287
266
  end
288
267
  end
@@ -86,6 +86,11 @@ module AdvancedBilling
86
86
  def initialize(street: SKIP, line2: SKIP, city: SKIP, state: SKIP,
87
87
  zip: SKIP, country: SKIP, name: SKIP, phone: SKIP,
88
88
  additional_properties: {})
89
+ # Add additional model properties to the instance.
90
+ additional_properties.each do |_name, _value|
91
+ instance_variable_set("@#{_name}", _value)
92
+ end
93
+
89
94
  @street = street unless street == SKIP
90
95
  @line2 = line2 unless line2 == SKIP
91
96
  @city = city unless city == SKIP
@@ -94,11 +99,6 @@ module AdvancedBilling
94
99
  @country = country unless country == SKIP
95
100
  @name = name unless name == SKIP
96
101
  @phone = phone unless phone == SKIP
97
-
98
- # Add additional model properties to the instance.
99
- additional_properties.each do |_name, _value|
100
- instance_variable_set("@#{_name}", _value)
101
- end
102
102
  end
103
103
 
104
104
  # Creates an instance of the object from a hash.
@@ -116,7 +116,7 @@ module AdvancedBilling
116
116
  phone = hash.key?('phone') ? hash['phone'] : SKIP
117
117
 
118
118
  # Clean out expected properties from Hash.
119
- names.each_value { |k| hash.delete(k) }
119
+ additional_properties = hash.reject { |k, _| names.value?(k) }
120
120
 
121
121
  # Create object from extracted values.
122
122
  OrganizationAddress.new(street: street,
@@ -127,7 +127,7 @@ module AdvancedBilling
127
127
  country: country,
128
128
  name: name,
129
129
  phone: phone,
130
- additional_properties: hash)
130
+ additional_properties: additional_properties)
131
131
  end
132
132
  end
133
133
  end
@@ -39,13 +39,13 @@ module AdvancedBilling
39
39
  end
40
40
 
41
41
  def initialize(uid: SKIP, number: SKIP, additional_properties: {})
42
- @uid = uid unless uid == SKIP
43
- @number = number unless number == SKIP
44
-
45
42
  # Add additional model properties to the instance.
46
43
  additional_properties.each do |_name, _value|
47
44
  instance_variable_set("@#{_name}", _value)
48
45
  end
46
+
47
+ @uid = uid unless uid == SKIP
48
+ @number = number unless number == SKIP
49
49
  end
50
50
 
51
51
  # Creates an instance of the object from a hash.
@@ -57,12 +57,12 @@ module AdvancedBilling
57
57
  number = hash.key?('number') ? hash['number'] : SKIP
58
58
 
59
59
  # Clean out expected properties from Hash.
60
- names.each_value { |k| hash.delete(k) }
60
+ additional_properties = hash.reject { |k, _| names.value?(k) }
61
61
 
62
62
  # Create object from extracted values.
63
63
  OriginInvoice.new(uid: uid,
64
64
  number: number,
65
- additional_properties: hash)
65
+ additional_properties: additional_properties)
66
66
  end
67
67
 
68
68
  # Validates an instance of the object from a given value.
@@ -42,13 +42,13 @@ module AdvancedBilling
42
42
  end
43
43
 
44
44
  def initialize(pricing_scheme:, prices: SKIP, additional_properties: {})
45
- @pricing_scheme = pricing_scheme
46
- @prices = prices unless prices == SKIP
47
-
48
45
  # Add additional model properties to the instance.
49
46
  additional_properties.each do |_name, _value|
50
47
  instance_variable_set("@#{_name}", _value)
51
48
  end
49
+
50
+ @pricing_scheme = pricing_scheme
51
+ @prices = prices unless prices == SKIP
52
52
  end
53
53
 
54
54
  # Creates an instance of the object from a hash.
@@ -70,12 +70,12 @@ module AdvancedBilling
70
70
  prices = SKIP unless hash.key?('prices')
71
71
 
72
72
  # Clean out expected properties from Hash.
73
- names.each_value { |k| hash.delete(k) }
73
+ additional_properties = hash.reject { |k, _| names.value?(k) }
74
74
 
75
75
  # Create object from extracted values.
76
76
  OveragePricing.new(pricing_scheme: pricing_scheme,
77
77
  prices: prices,
78
- additional_properties: hash)
78
+ additional_properties: additional_properties)
79
79
  end
80
80
 
81
81
  # Validates an instance of the object from a given value.
@@ -70,16 +70,16 @@ module AdvancedBilling
70
70
  def initialize(activated_at: SKIP, canceled_at: SKIP,
71
71
  cancellation_message: SKIP, expires_at: SKIP,
72
72
  current_period_starts_at: SKIP, additional_properties: {})
73
+ # Add additional model properties to the instance.
74
+ additional_properties.each do |_name, _value|
75
+ instance_variable_set("@#{_name}", _value)
76
+ end
77
+
73
78
  @activated_at = activated_at unless activated_at == SKIP
74
79
  @canceled_at = canceled_at unless canceled_at == SKIP
75
80
  @cancellation_message = cancellation_message unless cancellation_message == SKIP
76
81
  @expires_at = expires_at unless expires_at == SKIP
77
82
  @current_period_starts_at = current_period_starts_at unless current_period_starts_at == SKIP
78
-
79
- # Add additional model properties to the instance.
80
- additional_properties.each do |_name, _value|
81
- instance_variable_set("@#{_name}", _value)
82
- end
83
83
  end
84
84
 
85
85
  # Creates an instance of the object from a hash.
@@ -111,7 +111,7 @@ module AdvancedBilling
111
111
  end
112
112
 
113
113
  # Clean out expected properties from Hash.
114
- names.each_value { |k| hash.delete(k) }
114
+ additional_properties = hash.reject { |k, _| names.value?(k) }
115
115
 
116
116
  # Create object from extracted values.
117
117
  OverrideSubscription.new(activated_at: activated_at,
@@ -119,7 +119,7 @@ module AdvancedBilling
119
119
  cancellation_message: cancellation_message,
120
120
  expires_at: expires_at,
121
121
  current_period_starts_at: current_period_starts_at,
122
- additional_properties: hash)
122
+ additional_properties: additional_properties)
123
123
  end
124
124
 
125
125
  def to_custom_activated_at
@@ -31,12 +31,12 @@ module AdvancedBilling
31
31
  end
32
32
 
33
33
  def initialize(subscription:, additional_properties: {})
34
- @subscription = subscription
35
-
36
34
  # Add additional model properties to the instance.
37
35
  additional_properties.each do |_name, _value|
38
36
  instance_variable_set("@#{_name}", _value)
39
37
  end
38
+
39
+ @subscription = subscription
40
40
  end
41
41
 
42
42
  # Creates an instance of the object from a hash.
@@ -47,11 +47,11 @@ module AdvancedBilling
47
47
  subscription = OverrideSubscription.from_hash(hash['subscription']) if hash['subscription']
48
48
 
49
49
  # Clean out expected properties from Hash.
50
- names.each_value { |k| hash.delete(k) }
50
+ additional_properties = hash.reject { |k, _| names.value?(k) }
51
51
 
52
52
  # Create object from extracted values.
53
53
  OverrideSubscriptionRequest.new(subscription: subscription,
54
- additional_properties: hash)
54
+ additional_properties: additional_properties)
55
55
  end
56
56
  end
57
57
  end
@@ -58,16 +58,16 @@ module AdvancedBilling
58
58
 
59
59
  def initialize(total_count: SKIP, current_page: SKIP, total_pages: SKIP,
60
60
  per_page: SKIP, metadata: SKIP, additional_properties: {})
61
+ # Add additional model properties to the instance.
62
+ additional_properties.each do |_name, _value|
63
+ instance_variable_set("@#{_name}", _value)
64
+ end
65
+
61
66
  @total_count = total_count unless total_count == SKIP
62
67
  @current_page = current_page unless current_page == SKIP
63
68
  @total_pages = total_pages unless total_pages == SKIP
64
69
  @per_page = per_page unless per_page == SKIP
65
70
  @metadata = metadata unless metadata == SKIP
66
-
67
- # Add additional model properties to the instance.
68
- additional_properties.each do |_name, _value|
69
- instance_variable_set("@#{_name}", _value)
70
- end
71
71
  end
72
72
 
73
73
  # Creates an instance of the object from a hash.
@@ -91,7 +91,7 @@ module AdvancedBilling
91
91
  metadata = SKIP unless hash.key?('metadata')
92
92
 
93
93
  # Clean out expected properties from Hash.
94
- names.each_value { |k| hash.delete(k) }
94
+ additional_properties = hash.reject { |k, _| names.value?(k) }
95
95
 
96
96
  # Create object from extracted values.
97
97
  PaginatedMetadata.new(total_count: total_count,
@@ -99,7 +99,7 @@ module AdvancedBilling
99
99
  total_pages: total_pages,
100
100
  per_page: per_page,
101
101
  metadata: metadata,
102
- additional_properties: hash)
102
+ additional_properties: additional_properties)
103
103
  end
104
104
  end
105
105
  end
@@ -54,15 +54,15 @@ module AdvancedBilling
54
54
 
55
55
  def initialize(invoice_id: SKIP, status: SKIP, due_amount: SKIP,
56
56
  paid_amount: SKIP, additional_properties: {})
57
- @invoice_id = invoice_id unless invoice_id == SKIP
58
- @status = status unless status == SKIP
59
- @due_amount = due_amount unless due_amount == SKIP
60
- @paid_amount = paid_amount unless paid_amount == SKIP
61
-
62
57
  # Add additional model properties to the instance.
63
58
  additional_properties.each do |_name, _value|
64
59
  instance_variable_set("@#{_name}", _value)
65
60
  end
61
+
62
+ @invoice_id = invoice_id unless invoice_id == SKIP
63
+ @status = status unless status == SKIP
64
+ @due_amount = due_amount unless due_amount == SKIP
65
+ @paid_amount = paid_amount unless paid_amount == SKIP
66
66
  end
67
67
 
68
68
  # Creates an instance of the object from a hash.
@@ -76,14 +76,14 @@ module AdvancedBilling
76
76
  paid_amount = hash.key?('paid_amount') ? hash['paid_amount'] : SKIP
77
77
 
78
78
  # Clean out expected properties from Hash.
79
- names.each_value { |k| hash.delete(k) }
79
+ additional_properties = hash.reject { |k, _| names.value?(k) }
80
80
 
81
81
  # Create object from extracted values.
82
82
  PaidInvoice.new(invoice_id: invoice_id,
83
83
  status: status,
84
84
  due_amount: due_amount,
85
85
  paid_amount: paid_amount,
86
- additional_properties: hash)
86
+ additional_properties: additional_properties)
87
87
  end
88
88
  end
89
89
  end
@@ -33,12 +33,12 @@ module AdvancedBilling
33
33
  end
34
34
 
35
35
  def initialize(hold: SKIP, additional_properties: {})
36
- @hold = hold unless hold == SKIP
37
-
38
36
  # Add additional model properties to the instance.
39
37
  additional_properties.each do |_name, _value|
40
38
  instance_variable_set("@#{_name}", _value)
41
39
  end
40
+
41
+ @hold = hold unless hold == SKIP
42
42
  end
43
43
 
44
44
  # Creates an instance of the object from a hash.
@@ -49,11 +49,11 @@ module AdvancedBilling
49
49
  hold = AutoResume.from_hash(hash['hold']) if hash['hold']
50
50
 
51
51
  # Clean out expected properties from Hash.
52
- names.each_value { |k| hash.delete(k) }
52
+ additional_properties = hash.reject { |k, _| names.value?(k) }
53
53
 
54
54
  # Create object from extracted values.
55
55
  PauseRequest.new(hold: hold,
56
- additional_properties: hash)
56
+ additional_properties: additional_properties)
57
57
  end
58
58
  end
59
59
  end
@@ -142,6 +142,11 @@ module AdvancedBilling
142
142
  zip: SKIP, country: SKIP, phone: SKIP, locale: SKIP,
143
143
  vat_number: SKIP, tax_exempt: SKIP, tax_exempt_reason: SKIP,
144
144
  metafields: SKIP, additional_properties: {})
145
+ # Add additional model properties to the instance.
146
+ additional_properties.each do |_name, _value|
147
+ instance_variable_set("@#{_name}", _value)
148
+ end
149
+
145
150
  @first_name = first_name unless first_name == SKIP
146
151
  @last_name = last_name unless last_name == SKIP
147
152
  @email = email unless email == SKIP
@@ -160,11 +165,6 @@ module AdvancedBilling
160
165
  @tax_exempt = tax_exempt unless tax_exempt == SKIP
161
166
  @tax_exempt_reason = tax_exempt_reason unless tax_exempt_reason == SKIP
162
167
  @metafields = metafields unless metafields == SKIP
163
-
164
- # Add additional model properties to the instance.
165
- additional_properties.each do |_name, _value|
166
- instance_variable_set("@#{_name}", _value)
167
- end
168
168
  end
169
169
 
170
170
  # Creates an instance of the object from a hash.
@@ -193,7 +193,7 @@ module AdvancedBilling
193
193
  metafields = hash.key?('metafields') ? hash['metafields'] : SKIP
194
194
 
195
195
  # Clean out expected properties from Hash.
196
- names.each_value { |k| hash.delete(k) }
196
+ additional_properties = hash.reject { |k, _| names.value?(k) }
197
197
 
198
198
  # Create object from extracted values.
199
199
  PayerAttributes.new(first_name: first_name,
@@ -214,7 +214,7 @@ module AdvancedBilling
214
214
  tax_exempt: tax_exempt,
215
215
  tax_exempt_reason: tax_exempt_reason,
216
216
  metafields: metafields,
217
- additional_properties: hash)
217
+ additional_properties: additional_properties)
218
218
  end
219
219
 
220
220
  # Validates an instance of the object from a given value.
@@ -46,14 +46,14 @@ module AdvancedBilling
46
46
 
47
47
  def initialize(last_name: SKIP, first_name: SKIP, email: SKIP,
48
48
  additional_properties: {})
49
- @last_name = last_name unless last_name == SKIP
50
- @first_name = first_name unless first_name == SKIP
51
- @email = email unless email == SKIP
52
-
53
49
  # Add additional model properties to the instance.
54
50
  additional_properties.each do |_name, _value|
55
51
  instance_variable_set("@#{_name}", _value)
56
52
  end
53
+
54
+ @last_name = last_name unless last_name == SKIP
55
+ @first_name = first_name unless first_name == SKIP
56
+ @email = email unless email == SKIP
57
57
  end
58
58
 
59
59
  # Creates an instance of the object from a hash.
@@ -66,13 +66,13 @@ module AdvancedBilling
66
66
  email = hash.key?('email') ? hash['email'] : SKIP
67
67
 
68
68
  # Clean out expected properties from Hash.
69
- names.each_value { |k| hash.delete(k) }
69
+ additional_properties = hash.reject { |k, _| names.value?(k) }
70
70
 
71
71
  # Create object from extracted values.
72
72
  PayerError.new(last_name: last_name,
73
73
  first_name: first_name,
74
74
  email: email,
75
- additional_properties: hash)
75
+ additional_properties: additional_properties)
76
76
  end
77
77
  end
78
78
  end
@@ -36,13 +36,13 @@ module AdvancedBilling
36
36
  end
37
37
 
38
38
  def initialize(previous_value:, current_value:, additional_properties: {})
39
- @previous_value = previous_value
40
- @current_value = current_value
41
-
42
39
  # Add additional model properties to the instance.
43
40
  additional_properties.each do |_name, _value|
44
41
  instance_variable_set("@#{_name}", _value)
45
42
  end
43
+
44
+ @previous_value = previous_value
45
+ @current_value = current_value
46
46
  end
47
47
 
48
48
  # Creates an instance of the object from a hash.
@@ -55,12 +55,12 @@ module AdvancedBilling
55
55
  current_value = hash.key?('current_value') ? hash['current_value'] : nil
56
56
 
57
57
  # Clean out expected properties from Hash.
58
- names.each_value { |k| hash.delete(k) }
58
+ additional_properties = hash.reject { |k, _| names.value?(k) }
59
59
 
60
60
  # Create object from extracted values.
61
61
  PaymentCollectionMethodChanged.new(previous_value: previous_value,
62
62
  current_value: current_value,
63
- additional_properties: hash)
63
+ additional_properties: additional_properties)
64
64
  end
65
65
 
66
66
  # Validates an instance of the object from a given value.
@@ -52,15 +52,15 @@ module AdvancedBilling
52
52
 
53
53
  def initialize(id: SKIP, amount_in_cents: SKIP, success: SKIP, memo: SKIP,
54
54
  additional_properties: {})
55
- @id = id unless id == SKIP
56
- @amount_in_cents = amount_in_cents unless amount_in_cents == SKIP
57
- @success = success unless success == SKIP
58
- @memo = memo unless memo == SKIP
59
-
60
55
  # Add additional model properties to the instance.
61
56
  additional_properties.each do |_name, _value|
62
57
  instance_variable_set("@#{_name}", _value)
63
58
  end
59
+
60
+ @id = id unless id == SKIP
61
+ @amount_in_cents = amount_in_cents unless amount_in_cents == SKIP
62
+ @success = success unless success == SKIP
63
+ @memo = memo unless memo == SKIP
64
64
  end
65
65
 
66
66
  # Creates an instance of the object from a hash.
@@ -75,14 +75,14 @@ module AdvancedBilling
75
75
  memo = hash.key?('memo') ? hash['memo'] : SKIP
76
76
 
77
77
  # Clean out expected properties from Hash.
78
- names.each_value { |k| hash.delete(k) }
78
+ additional_properties = hash.reject { |k, _| names.value?(k) }
79
79
 
80
80
  # Create object from extracted values.
81
81
  PaymentForAllocation.new(id: id,
82
82
  amount_in_cents: amount_in_cents,
83
83
  success: success,
84
84
  memo: memo,
85
- additional_properties: hash)
85
+ additional_properties: additional_properties)
86
86
  end
87
87
 
88
88
  # Validates an instance of the object from a given value.